Jump to content

Custom message in cart


Recommended Posts

Hello ladies and gentlemen!

I would like to add a custom message in cart. I can't hook something in "displayshoppingcart" so I searched in forums to find another solution. I found something in forums but it doesn't work. They said to make these changes on the following code.

I add the red part in the blockcart.php. Here is the code : 

 $this->smarty->assign(array(

            'customizedMessage', $customizedMessage,
            'products' => $products,
            'customizedDatas' => Product::getAllCustomizedDatas((int)($params['cart']->id)),
            'CUSTOMIZE_FILE' => _CUSTOMIZE_FILE_,
            'CUSTOMIZE_TEXTFIELD' => _CUSTOMIZE_TEXTFIELD_,
            'discounts' => $cart_rules,
            'nb_total_products' => (int)($nbTotalProducts),
            'shipping_cost' => $shipping_cost,
            'shipping_cost_float' => $shipping_cost_float,
            'show_wrapping' => $wrappingCost > 0 ? true : false,
            'show_tax' => (int)(Configuration::get('PS_TAX_DISPLAY') == 1 && (int)Configuration::get('PS_TAX')),
            'wrapping_cost' => Tools::displayPrice($wrappingCost, $currency),
            'product_total' => Tools::displayPrice($params['cart']->getOrderTotal($useTax, Cart::BOTH_WITHOUT_SHIPPING), $currency),
            'total' => Tools::displayPrice($totalToPay, $currency),
            'order_process' => Configuration::get('PS_ORDER_PROCESS_TYPE') ? 'order-opc' : 'order',
            'ajax_allowed' => (int)(Configuration::get('PS_BLOCK_CART_AJAX')) == 1 ? true : false,
            'static_token' => Tools::getToken(false)
        ));

 

Then in blockcart.tpl I add the following code :
 

 {if isset($customizedMessage)}

                    {l s="some title or header of customized message" mod="blockcart"}{$customizedMessage}

            {/if}

Any solution?

 

Thanks in advance !

Link to comment
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
×
×
  • Create New...