Jump to content

only product total in blockcart, no shipping price?


138th st

Recommended Posts

Right now we are using $total but we are tryng to show the price of just the products together in the cartblock and show the total price at the check out.
We only have tax for a few locations, so we dont have to worry about that showing up.



I couldn’t find a variable that would work in the block cart for this – maybe there is one?

I also tried this: {math equation=‘x – y’ x=$total y=$shipping_cost} but that didn’t seem to work.

could someone please point me in the right direction? Thanks

Link to comment
Share on other sites

Have a look in "modules/blockcart/blockcart.php"

Could try this:
Change

            'total' => Tools::displayPrice($params['cart']->getOrderTotal(intval(Configuration::get('PS_PRICE_DISPLAY')) == 1 ? false : true), $currency),



To

            'total' => Tools::displayPrice($params['cart']->getOrderTotal(intval(Configuration::get('PS_PRICE_DISPLAY')) == 1 ? false : true, 4), $currency),

Link to comment
Share on other sites

See "classes/Cart.php" for the getOrderTotal function.

    /**
   * This function returns the total cart amount
   *
   * type = 1 : only products
   * type = 2 : only discounts
   * type = 3 : both
   * type = 4 : both but without shipping
   * type = 5 : only shipping
   * type = 6 : only wrapping
   * type = 7 : only products without shipping
   *
   * @param boolean $withTaxes With or without taxes
   * @param integer $type Total type
   * @return float Order total
   */

Link to comment
Share on other sites

  • 4 months later...
  • 4 years later...

Thanks,

 

it helped me

The  values are as folows now

 

$array_type = array(
            Cart::ONLY_PRODUCTS,
            Cart::ONLY_DISCOUNTS,
            Cart::BOTH,
            Cart::BOTH_WITHOUT_SHIPPING,
            Cart::ONLY_SHIPPING,
            Cart::ONLY_WRAPPING,
            Cart::ONLY_PRODUCTS_WITHOUT_SHIPPING,
            Cart::ONLY_PHYSICAL_PRODUCTS_WITHOUT_SHIPPING,

 

 

And I changed the value as follow in the blockcart.tpl

 

<span class="ajax_cart_total{if $cart_qties == 0} unvisible{/if}">
            {if $cart_qties > 0}
                {if $priceDisplay == 1}
                    {assign var='blockcart_cart_flag' value='Cart::BOTH'|constant}
                    {convertPrice price=$cart->getOrderTotal(false, $blockcart_cart_flag)}
                {else}
                    {assign var='blockcart_cart_flag' value='Cart::BOTH'|constant}
                    {convertPrice price=$cart->getOrderTotal(true, $blockcart_cart_flag)}
                {/if}
            {/if}
        </span>

 

 

Previously, I had the value "Cart::BOTH_WITHOUT_SHIPPING"

Edited by GenZai (see edit history)
Link to comment
Share on other sites

  • 9 months later...

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...