V
V
Vyacheslav_Frein2020-12-11 18:02:28
MODX
Vyacheslav_Frein, 2020-12-11 18:02:28

How to change the value of the amount of goods in the minishop2 modx revo cart?

Good evening, there is a simple online store on minishop2, how to make the amount of goods in the basket increase by 300 rubles, provided that the goods in the basket are less than 5000 rubles?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Arthur Sh, 2021-02-06
@Shev_Art_V

More or less like this

<?php
switch ($modx->event->name) {
case 'msOnAddToCart':
    $tmp = $cart->get();
   if($tmp['total_cost'] < 5000){
        $tmp[$key]['total_cost'] =  $tmp[$key]['total_cost'] + 300;
        $cart->set($tmp);
    }
    break;

Well, read the documentation.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question