Post by glolar » Sun Jun 18, 2017 8:50 am

Hello,

I have set the Out of Stock Status on one of my products to "Pre-Order". That causes the Availability to be shown as "Pre-Order" and causes the Add to Cart button to be a "Pre-Order" button, but the button is disabled. See the problem at:

www.skyreadyrc.com/store/index.php?rout ... duct_id=73

Does anyone know how to fix this?

Thanks,
Larry Sanford

User avatar
Newbie

Posts

Joined
Thu Jul 29, 2010 12:35 pm
Location - San Diego, CA

Post by IP_CAM » Sun Jun 18, 2017 11:30 am

is there really such a PRE-Order Button built-in in your DEFAULT OC Version,
or do you use some Extension ?
Ernie

Ernie's OpenShop 1.75 with responsive Bootstrap Themes:
http://www.bigmax.ch - http://www.hitline.info - http://www.openshop.li
Image


User avatar
Newbie

Posts

Joined
Tue Mar 04, 2014 1:37 am
Location - Switzerland

Post by glolar » Sun Jun 18, 2017 11:57 am

No extensions. I just set the Out of Stock Status for a product to "Pre-Order" (it's in the dropdown, along with "Out of Stock", etc). The whole purpose of his is to allow customers to Pre-Order products that are out of stock.

But the Pre-Order button is disabled, and it shouldn't be.

User avatar
Newbie

Posts

Joined
Thu Jul 29, 2010 12:35 pm
Location - San Diego, CA

Post by GoGo OpenCart » Mon Jun 19, 2017 12:49 am

I suppose this has somehting to do with your theme, and I can see it changes the button only on the main product's page, and not on the other places, like Category, Manufacturer, Search, etc., and I have a module (the Enabled version of the module) that can do exactly what you want:

https://www.opencart.com/index.php?rout ... on_id=4358

If you have any questions, feel free to write me a PM ;)

See all my extensions: https://www.opencart.com/index.php?rout ... 20OpenCart


User avatar
Newbie

Posts

Joined
Mon Nov 14, 2011 11:30 pm

Post by IP_CAM » Mon Jun 19, 2017 12:58 am

well, I don't install a v.2.3.x, just to find out, but I see NO single line of code in OC 2.3
to make this Pre-Order Button/Function to display or work, if no stock exists, so,
it must be related to your Custom 'theme708', and you better get in touch
with the Theme seller, to find out.
Good Luck
Ernie

Ernie's OpenShop 1.75 with responsive Bootstrap Themes:
http://www.bigmax.ch - http://www.hitline.info - http://www.openshop.li
Image


User avatar
Newbie

Posts

Joined
Tue Mar 04, 2014 1:37 am
Location - Switzerland

Post by glolar » Mon Jun 19, 2017 2:53 am

IP_CAM, I found the offending code in catalog\view\theme\theme708\template\product\product.tpl:

<!-- Add to cart form -->
<div class="form-group form-horizontal">
<div class="form-group">
<div class="col-sm-12 quantity">
<label class="control-label" for="input-quantity"><?php echo $entry_qty; ?></label>
<a class="counter counter-minus material-design-horizontal39" href='#'></a>
<input type="text" name="quantity" value="<?php echo $minimum; ?>" size="2" id="input-quantity" class="form-control"/>
<input type="hidden" name="product_id" value="<?php echo $product_id; ?>"/>
<a class="counter counter-plus material-design-add186" href='#'></a>
<button <?php echo $stock_status <= 0 ? 'disabled' : ''; ?> type="button" id="button-cart" data-loading-text="<?php echo $text_loading; ?>" class="product-btn-add"><?php echo $stock_status <= 0 ? $stock : $button_cart; ?></button>
</div>
</div>
</div>

You can see that the <button> tag contains some php code that disables the button if $stock_status <=0. What it SHOULD be doing is something like this:

<button <?php echo $stock_status <= 0 && $out_of_stock_status != 5? 'disabled' : ''; ?>

An out of stock status of 5 is "Pre-Order", but the code above generates an error. I don't know exactly how to check for "Out of Stock Status = Pre-Order". There is currently no "$out_of_stock_status" variable to check, but there must be some variable I can check to see if the product has an Out of Stock Status set to "Pre-Order".

GoGo OpenCart: Your plugin looks good, and there are nothing but great comments from your customers, so they obviously love your product and your support. I will definitely check out your plugin, but for now, I just need the proper syntax for the code that will fix this. I need to know what the code would be for checking if "Out of Stock Status = 'Pre-Order'". Also, do you offer any other plugins for OpenCart 2.3.0.2? I would like to check them out.

Hoping someone knows how to fix the button tag above so that the button for a Pre-Order product is NOT disabled.

Thanks in advance!

Larry Sanford

User avatar
Newbie

Posts

Joined
Thu Jul 29, 2010 12:35 pm
Location - San Diego, CA

Post by GoGo OpenCart » Mon Jun 19, 2017 6:05 am

glolar wrote:
Mon Jun 19, 2017 2:53 am
Hoping someone knows how to fix the button tag above so that the button for a Pre-Order product is NOT disabled.
The thing is that even if you sort it out on the main product's page, the button will still stay the same on the other places, so not sure if that will be of any help for you, but if you want, send me your email address via PM, so I can contact you, and I'll help you out with it on the main product's page ;)

glolar wrote:
Mon Jun 19, 2017 2:53 am
GoGo OpenCart: Your plugin looks good, and there are nothing but great comments from your customers, so they obviously love your product and your support. I will definitely check out your plugin, but for now, I just need the proper syntax for the code that will fix this. I need to know what the code would be for checking if "Out of Stock Status = 'Pre-Order'". Also, do you offer any other plugins for OpenCart 2.3.0.2? I would like to check them out.
I try my best, and it's my duty to make sure that all of my modules are working as it should, without a problem, and all that comes with all those 5 stars votes and all the nice and positive comments about the modules and my fast and prompt help, for all of my modules :) Here's the list of all of my modules, you might find something else useful :)

https://www.opencart.com/index.php?rout ... 20OpenCart

Those three are the most popular:

https://www.opencart.com/index.php?rout ... on_id=4098

And:

https://www.opencart.com/index.php?rout ... on_id=4358

And:

https://www.opencart.com/index.php?rout ... on_id=4067

Waiting for your email address ;)

See all my extensions: https://www.opencart.com/index.php?rout ... 20OpenCart


User avatar
Newbie

Posts

Joined
Mon Nov 14, 2011 11:30 pm

Post by glolar » Mon Jun 19, 2017 9:50 pm

Go Go OpenCart, my email address is info@glolar.com.

Larry Sanford

User avatar
Newbie

Posts

Joined
Thu Jul 29, 2010 12:35 pm
Location - San Diego, CA

Post by GoGo OpenCart » Mon Jun 19, 2017 10:00 pm

glolar wrote:
Mon Jun 19, 2017 9:50 pm
Go Go OpenCart, my email address is info@glolar.com.

Larry Sanford
I sent you an email, so please check it.

See all my extensions: https://www.opencart.com/index.php?rout ... 20OpenCart


User avatar
Newbie

Posts

Joined
Mon Nov 14, 2011 11:30 pm
Who is online

Users browsing this forum: DigitCart, thekrotek and 23 guests