When I order products on my site with options that are NOT REQUIRED the item goes directly into the cart and the product page with the options does not even appear. If I have options that ARE required, both the required options and non required options appear. Here is my URL:
http://tequilasauthenticmexican.210worl ... ry&path=59
The test product here has both required and non required options while all 3 of the other products here have non required options. Please help as I need to deliver this site tonight.
Also, FYI, I am not receiving notifications when people reply to my posts even though I check the box to receive them.
Thank you.
http://tequilasauthenticmexican.210worl ... ry&path=59
The test product here has both required and non required options while all 3 of the other products here have non required options. Please help as I need to deliver this site tonight.
Also, FYI, I am not receiving notifications when people reply to my posts even though I check the box to receive them.
Thank you.
Thank you,
Sully
as i understand you already fixed your issue? or explained the problem incorrectly... I have checked and did not find anything strange in your options mechanism's behaviour...sully210 wrote:When I order products on my site with options that are NOT REQUIRED the item goes directly into the cart and the product page with the options does not even appear. If I have options that ARE required, both the required options and non required options appear.
If all OK, close the topic
Opencarting
It works when I click the product title, but not when I click "ORDER" in
I have tested it in all browsers and get the same result. I will check the code for that file and see if there is something wrong.
Code: Select all
<button type="button" onclick="cart.add('121', '1');"><i class="fa fa-shopping-cart"></i> <span class="order-add">Order</span></button>
Thank you,
Sully
I have checked the code and it is still not working. Though I did indeed modify the product/category.tpl file the code for that particular button group matches the code from the original file. I even uploaded the original 2.0.3.1 file and that did not work either. I have cleared all cache and done a hard refresh of the page every time as well. For some reason, clicking the word "ORDER" sends the products directly to the cart, no matter what. Any help on fixing this is greatly appreciated.
Thank you,
Sully
Hi Sully,
If I understand correctly you want the customer to be redirected to the product page if there are options, required or not. You can do this by changing the controller/checkout/cart::add method.
Something like: if product_options and route is not product/product add a new json error so it redirects to the product page.
If I understand correctly you want the customer to be redirected to the product page if there are options, required or not. You can do this by changing the controller/checkout/cart::add method.
Something like: if product_options and route is not product/product add a new json error so it redirects to the product page.
Attn: I no longer provide OpenCart extensions, nor future support - this includes forum posts.
Reason: OpenCart version 3+
Thanks!
Thanks. That sounds complicated for someone like me but I will try it when I get a few minutes.artcore wrote:Hi Sully,
If I understand correctly you want the customer to be redirected to the product page if there are options, required or not. You can do this by changing the controller/checkout/cart::add method.
Something like: if product_options and route is not product/product add a new json error so it redirects to the product page.
Thank you,
Sully
It is a bit more complicated as the route is the url in ajax. Below should work. Don't forget to refresh the modification cache!
controller/checkout/cart/add
product.tpl
controller/checkout/cart/add
Code: Select all
//redirect to product page if there are options, required or not
if(!empty($product_options)){
$route = isset($this->request->get['product_page'])
? $this->request->get['product_page']
: 0;
if($route == '0'){
$json['error'] = 'check our options first';//not used anyway
}
}
//redirect to product page if there are options, required or not//
Code: Select all
$('#button-cart').on('click', function() {
$.ajax({
url: 'index.php?route=checkout/cart/add&product_page=1',//add &product_page=1 to the url
.....
Attn: I no longer provide OpenCart extensions, nor future support - this includes forum posts.
Reason: OpenCart version 3+
Thanks!
Code: Select all
$('#button-cart').on('click', function() {
$.ajax({
url: 'index.php?route=checkout/cart/add&product_page=1',//add &product_page=1 to the url
.....
Code: Select all
<?php echo $header; ?>
Thank you,
Sully
That one is javascript
I commented on what I changed and added some lines extra so you can pinpoint it easier.
catalog/view/theme/default/template/product/product.tpl
becomes
The screenshot should help find the spot for the other change in ... cart.php
And don't forget to clear modification cache!
Tested on my demo: http://demo.ilithemes.com/oc2302/laptop-notebook
That HP LP3065 has an option that's not required
I commented on what I changed and added some lines extra so you can pinpoint it easier.
catalog/view/theme/default/template/product/product.tpl
Code: Select all
url: 'index.php?route=checkout/cart/add',
Code: Select all
url: 'index.php?route=checkout/cart/add&product_page=1',
And don't forget to clear modification cache!
Tested on my demo: http://demo.ilithemes.com/oc2302/laptop-notebook
That HP LP3065 has an option that's not required
Attn: I no longer provide OpenCart extensions, nor future support - this includes forum posts.
Reason: OpenCart version 3+
Thanks!
Who is online
Users browsing this forum: No registered users and 240 guests