Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Shopping cart fails to change quantity


ArtcoInc

Recommended Posts

osCommerce 2.3.4 Responsive (pre-Gold)

*** Solution below ***

Problem:

I can add an item to the shopping cart, I can delete the item from the cart, but I can not adjust the quantity. When I change the quantity and click on the refresh button, the quantity reverts back to 1.

History:

The site has been live for almost 2 years. Initially, the site did not have an SSL certificate on it. To the best of my knowledge, the ability to adjust the quantity worked in the past.

A few months ago, I added a full-site SSL certificate.

Today, a customer complained that they could not adjust the quantity in the shopping cart. I tested the site, and found this to be true. Debugging using console, I see this warning ...

Quote

 

shopping_cart.php:300

Mixed Content: The page at 'https://www.<domain>.com/catalog/shopping_cart.php' was loaded over a secure connection, but contains a form which targets an insecure endpoint 'http://www.<domain>.com/catalog/shopping_cart.php?action=update_product'. This endpoint should be made available over a secure connection.

 

Solution:

In shopping_cart.php ...

Find

<?php echo tep_draw_form('cart_quantity', tep_href_link(FILENAME_SHOPPING_CART, 'action=update_product')); ?>

Replace with:

<?php echo tep_draw_form('cart_quantity', tep_href_link(FILENAME_SHOPPING_CART, 'action=update_product', $request_type)); ?>

 tep_href_link() defaults to a non-ssl link UNLESS specifically told otherwise! This created the Mixed Content error, preventing the quantity to be adjusted. With this change, the quantity update function now works :cool:

 

I had run into the same problem with the contact_us page. I think that the entire store needs to be gone through, and all instances of tep_href_link() should be updated.

HTH

Malcolm

Link to comment
Share on other sites

Why not change the tep_href_link function to default ssl instead? 

Link to comment
Share on other sites

And just to be sure: you changed in configure.php: HTTP_SERVER also to https:// , if yes then this shouldn't happen.

Link to comment
Share on other sites

Malcolm @ArtcoInc

Change to this and you will not have any more problems with it except for hardcoded links which do not use the tep_href_link function:

define('HTTP_SERVER', 'https://www.<domain>.com');

thats the trick to make all your store ssl without bothering about changing all the links :wink:

Link to comment
Share on other sites

@raiwa

38 minutes ago, raiwa said:

Why not change the tep_href_link function to default ssl instead? 

Because I am trying not to change 'core files' :happy:

 

24 minutes ago, raiwa said:

Malcolm @ArtcoInc

Change to this and you will not have any more problems with it except for hardcoded links which do not use the tep_href_link function:


define('HTTP_SERVER', 'https://www.<domain>.com');

thats the trick to make all your store ssl without bothering about changing all the links :wink:

Changed. And the quantity still can be adjusted.:smile:

Thank you!

Malcolm

 

Link to comment
Share on other sites

Malcolm @ArtcoInc,

 

there are some hardcoded links in the social bookmark modules which produce ssl validation errors if I well remember. You might like to check and change them if you use them.

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...