nackito Posted March 28, 2018 Share Posted March 28, 2018 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 More sharing options...
nackito Posted March 29, 2018 Author Share Posted March 29, 2018 Nobody ? Link to comment Share on other sites More sharing options...
sunnydesigner Posted March 30, 2018 Share Posted March 30, 2018 Hi, Where your customized message from ? does need customers to type it ? if it is some static block, you can modify shopping cart .tpl file directly. Best regards. Link to comment Share on other sites More sharing options...
nackito Posted March 30, 2018 Author Share Posted March 30, 2018 (edited) Hello! Thanks a lot for your feedback! It's just a static block to infrom the customers. Which part should I edit ? Edit: I can only find blockcart.tpl . Thanks in advance ! Edited March 30, 2018 by nackito (see edit history) Link to comment Share on other sites More sharing options...
tdsoft Posted March 30, 2018 Share Posted March 30, 2018 how to customer can enter data for this fielf in frontend? Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now