Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Lots of bugs with remove from cart, drop down menus, grid/list buttons, and photo popups. Stock install of BS.


wildvettes

Recommended Posts

4 hours ago, MrPhil said:

"bone stock" meaning the very latest osC 2.3.4BS Edge (direct from GitHub), and not Gold or some other earlier version someone had cached? What PHP version? Server? MySQL? Unfortunately, without version numbers, it's difficult to tell what version of Edge you're actually at.

You should be able to migrate your data (including the database) to the latest Edge without much effort, so you won't lose any work or customer data.

If you're already at the latest Edge, and the problem boils down to { } in the Query String, per the other discussion you'll have to either URLencode the string (which works, but looks ugly), or replace { } with . . or something else. I don't know when Gary or Harald are ever going to get around to doing that.

The new install of EDGE is from the link @burt supplied and the PHP version has been tried on 5.5, 5.6, and 7.0 with the same results. 

Link to comment
Share on other sites

@wildvettes

Both of them doesnt work on this site:

 

<a href="http://www.wildvettes.com/shopping_cart.php/products_id/617%25257B2%25257D83/action/remove_product">delete</a>

and urlencoded variants
 

<a href="http://www.wildvettes.com/shopping_cart.php/products_id/617%7B2%7D83/action/remove_product">alternative delete</a>


V2.4 use this code in OSCOM class

            $p = str_replace([
                "\\", // apps
                '{', // product attributes
                '}' // product attributes
            ], [
                '%5C',
                '%7B',
                '%7D'
            ], $p);

probably without any success on this site.. so we have to figure out more precisely

I see that "%25" is a double encoded "%" which wont be worked.


Try to use in application_top.php

change:
 

      // customer removes a product from their shopping cart
      case 'remove_product' : if (isset($HTTP_GET_VARS['products_id'])) {
                                $cart->remove($HTTP_GET_VARS['products_id']);
                              }
                              tep_redirect(tep_href_link($goto, tep_get_all_get_params($parameters)));
                              break;


to:
????

First we should know about cart->contents !!

Could you print out cart contents in shopping_cart.php?
 

print_r(var_dump($cart->contents)); exit();


I am not sure that this will be html output protected so could be better to print out into a debug file.

try to apply this function:

// write to file
function df($v) { $f=fopen('debug.txt', "w+"); fwrite(print_r($v, true)); fclose($f); }

df(var_dump($cart->contents));


What was the result?



 

:blink:
osCommerce based shop owner with minimal design and focused on background works. When the less is more.
Email managment with tracking pixel, package managment for shipping, stock management, warehouse managment with bar code reader, parcel shops management on 3000 pickup points without local store.

Link to comment
Share on other sites

estimated edition:
 

      // customer removes a product from their shopping cart
      case 'remove_product' : if (isset($HTTP_GET_VARS['products_id'])) {
                                $cart->remove(urldecode(urldecode(urldecode($HTTP_GET_VARS['products_id']))));
                              }
                              tep_redirect(tep_href_link($goto, tep_get_all_get_params($parameters)));
                              break;

It was a tip with 3 x urldecode().

:blink:
osCommerce based shop owner with minimal design and focused on background works. When the less is more.
Email managment with tracking pixel, package managment for shipping, stock management, warehouse managment with bar code reader, parcel shops management on 3000 pickup points without local store.

Link to comment
Share on other sites

I think I'm going to revert all code changes and just make the one to html_output.php as it isn't generating any error logs on the new test site (mine is now and ipage is blaming the issue on the error log). If someone can refer me to where the "What's in My Shopping Cart?" Text is located I'm going to add a line of text below it saying "To remove an item from your cart change the quantity to "0" and click the refresh arrows." That should at least band-aid this until I can get it figured out. 

If I could just remove the red x all together that would also be great, but I don't know if that would require a lot of core code changes. 

Thanks!

Link to comment
Share on other sites

32 minutes ago, Gergely said:

estimated edition:
 


      // customer removes a product from their shopping cart
      case 'remove_product' : if (isset($HTTP_GET_VARS['products_id'])) {
                                $cart->remove(urldecode(urldecode(urldecode($HTTP_GET_VARS['products_id']))));
                              }
                              tep_redirect(tep_href_link($goto, tep_get_all_get_params($parameters)));
                              break;

It was a tip with 3 x urldecode().

You sir nailed it!

 

Check out the test site now. The changes were yours in application_top.php and the other in html_output.php for the linking issue. 

 

www.lifitingpads.com/catalog/

 

You can now remove items with attributes from the shopping cart

Link to comment
Share on other sites

This is an abnormal fix. The comunication between web page and the server shows abnormal encoding loop backs. This wont be github commit.

:blink:
osCommerce based shop owner with minimal design and focused on background works. When the less is more.
Email managment with tracking pixel, package managment for shipping, stock management, warehouse managment with bar code reader, parcel shops management on 3000 pickup points without local store.

Link to comment
Share on other sites

  • 7 months later...

Been searching for the solution to this for a whille too.

Running 2.3.4.1
With the actions moved from application_top/php to the seperate folder actions.

Change:
 class osC_Actions_remove_product {
  function execute() {
    global $PHP_SELF, $messageStack, $cart, $goto, $parameters;
     
    if (isset($_GET['products_id'])) {      
      $pid = (int)$_GET['products_id'];

to:
 class osC_Actions_remove_product {
  function execute() {
    global $PHP_SELF, $messageStack, $cart, $goto, $parameters;
     
    if (isset($_GET['products_id'])) {      
      $pid = $_GET['products_id'];


So actually remove the (int) from the last line ( $pid = (int)$_GET['products_id'];).

Link to comment
Share on other sites

Archived

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

×
×
  • Create New...