Jump to content

jshap24

Member
  • Posts

    3
  • Joined

  • Last visited

Posts posted by jshap24

  1. On 6/5/2017 at 2:31 PM, bsandall said:

    Create a code snippet using the hook `class.cart.add.preredirect` and add the following code:

    
    <?php
    $category_id = $GLOBALS['db']->select('CubeCart_category_index','cat_id',array('product_id'=>$product_id,'primary'=>1));
    if ($category_id) {
        $redirect_url = $GLOBALS['seo']->buildURL('cat', $category_id[0]);
        if ($redirect_url) {
           httpredir($redirect_url); 
        }
    }
    ?>

    This will cause the page to redirect to the main category of the product any time a user adds it to the basket and avoids entirely the JS-powered auto-display of the side basket (though this basket can still be displayed if the user specifically clicks on it).

    Do note, however, that the script above does not elegantly handle the case where the user adds a product from any page other than the product page, for example if they added a product to their basket from the home page. Should be enough to get you started, though.

    Thanks so much!  I will give this a try today.

  2. Hello,

    This may be above my pay grade, but I'm trying to figure out how to change the Add to Basket button a bit.  Instead of simply popping up the box.basket.content window at the top of the screen and leaving the user on the same page, I would like it to add the item to basket and then return the user to the category or home page that they came from.  Doing this will update the static box.basket.content that I put where featured products used to be, sort of a forced refresh.

    If this is possible, I would then remove the shopping cart from the top of the nav bar, so the only place the basket content would appear is the one spot.

    Is this overly complicated or possible?

    Thanks,

    John

×
×
  • Create New...