M
M
Marat Agatov2021-01-29 00:51:19
MODX
Marat Agatov, 2021-01-29 00:51:19

How to display the total amount for each product in the Minishop2 cart?

It is necessary to display the total amount of the goods in the basket, so that it is updated when the quantity of goods for each product changes,
I could not find a solution.
This method is not suitable.
{$product.count * $product.price|replace:" ":""}
How is it possible to implement?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
M
Marat Agatov, 2021-02-08
@Orange-rus

Если минишоп последней версии, то просто оберни стоимость в
<span class="ms2_cost">270</span>
Если нет. то самое простое через js:
miniShop2.Callbacks.add('Cart.change.response.success', 'cart_change_ok', function() {
  // проходишься по каждой строке товара и умножаешь цену на кол-во
  $( "li" ).each(function( index ) {
    console.log( index + ": " + $( this ).text() );
  });
})

E
Eugene, 2021-02-02
@webinmd

Update Minishop2, this PR was accepted there with the functionality you need

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question