teo_g Posted November 13, 2014 Share Posted November 13, 2014 I want my client view in limited cart block, number of item not quantities.Example:I have 2 products X and Y. In actual form, if client put in cart 10 quantities from X and 5 quantities from Y, block cart show 15 products.I want my client view in summary of cart: "2 products (15 quantities)".How can I resolv this situation?Thanks! Link to comment Share on other sites More sharing options...
Tung at RockPOS.com Posted November 13, 2014 Share Posted November 13, 2014 (edited) Try this, in class `blockcart.php`, change line 121: $this->smarty->assign(array( '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), 'nb_total_products' => (int)($products),// CHANGE TO THIS ONE '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), 'free_shipping' => $total_free_shipping )); Edited November 13, 2014 by TungCEO (see edit history) Link to comment Share on other sites More sharing options...
teo_g Posted November 13, 2014 Author Share Posted November 13, 2014 Work one time! If refresh or go another page, summary cart show again quntities. Link to comment Share on other sites More sharing options...
Tung at RockPOS.com Posted November 14, 2014 Share Posted November 14, 2014 Ah, ok, I missed 1 case. Here is the fix, refer to lines 121-123: $this->smarty->assign(array( '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), 'nb_total_products' => count($products),// CHANGE TO THIS ONE 'cart_qties' => count($products),// ADD THIS TOO '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), 'free_shipping' => $total_free_shipping )); 1 Link to comment Share on other sites More sharing options...
teo_g Posted December 2, 2014 Author Share Posted December 2, 2014 Works best! Thanks @TungCEO Link to comment Share on other sites More sharing options...
Recommended Posts