Jump to content
Latest News: (loading..)
wildvettes

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

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. 

Share this post


Link to post
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.

Share this post


Link to post
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().

Edited by Gergely
+l into urdecode

: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.

Share this post


Link to post
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!

Share this post


Link to post
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

Share this post


Link to post
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.

Share this post


Link to post
Share on other sites

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'];).


Building great webshops for customers with opensource backoffice application for a robotic accounting solution including POS
Migrating osC 2.x webshops to 2.3.4.x
osCommerce dedicated hosting/colocation + turnkey solutions + building addons per request

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×