Recommended PrestShop Version

Thanks for choosing Agile.
For customers using our Agile Multiple Seller module and its accessry modules, we highly recommend to use PrestaShop 1.6x or 1.7.5 or lower. PrestaShop has made some changes in versions higher than 1.7.6 that makes it possible or very difficult to implement some of features via hooks, or override, since required hooks or override is not available.

Sept. 05, 2019

This section will asnwer following questions:

How can I change the locaiton of UpSell/Cross-sell products block?

How can I show the Upsell/Cross-sell block on other pages?


1. Change the location from bottom of the cart summary to the top of cart summary.

By default, the Upsell/Cross-sell product block is dipslayed at the botttom of the shopping cart summary pages.  See below:

agile-upsell-shopping-cart-summary

 

Some customers may want to change the location from the bottom to the top of the shopping cart summary page.  The following is how you can make that change.

Locate the following lines in shopping-cart.tpl file under your theme folder (YourStoreRoot/themes/YourStoreTheme/shopping-cart.tpl):

<p class="cart_navigation_extra">
    <span id="HOOK_SHOPPING_CART_EXTRA">{$HOOK_SHOPPING_CART_EXTRA}</span>
</p>

Move the those lines and insert them after following two lines which are at the top of the file:

{include file="$tpl_dir./order-steps.tpl"}
{include file="$tpl_dir./errors.tpl"}

After completing this change, you will need to temporarily disable smarty cache to force the change to be reflected.  Check here for how to diable smarty cache.

 

2. Add the hook to other pages.

Some customers may also want to this block to appear on the order addresses pages, which is the first step of the checkout process.  Here is a screen shot.  Because PrestaShop does not prvoide standard hooks for these pages, we will need to do a little more work to use the hook prepared by the module.

Here are the instructions oin how to do that:

1. Looking for following function in the "YourStoreRoot/controller/OrderController.php" file:

protected function _assignAddress()
{
parent::_assignAddress();
self::$smarty->assign('cart', self::$cart);
if (self::$cookie->is_guest)
Tools::redirect('order.php?step=2');
}



After following line:

 parent::_assignAddress();
 
Insert the following two lines:

$agilepostupsell = Module::hookExec('agilepostupsell', array());
self::$smarty->assign('HOOK_AGILE_POST_UPSELL', $agilepostupsell);
 
2. Next, look for following two lines in the file
"YourStoreRoot/themes/YourTheme/order-addresses.tpl":
 
{include file="$tpl_dir./order-steps.tpl"}
{include file="$tpl_dir./errors.tpl"}

After the above two line, insert following line:
{$HOOK_AGILE_POST_UPSELL}
Note:
If you want the Upsell product block to appear on the bottom of the page, you only need to make the changes in section 2 above to the button of the file.

After this, don't forget temporary disable smarty cache.  See the link below on how to do that.
http://addons-modules.com/en/content/19-how-to-disable-enable-smarty-and-force-compile


agile-upsell-order-address