! перевести с Google! Привет, народ! У меня есть два варианта метода доставка (A, B) и у меня есть один вариант оплаты (C). Я хочу, чтобы иметь возможность предупреждающим сообщением ($ JSON ['ошибки'] ['предупреждение'] = "Сообщение об ошибке"), если способ доставки = А и способ оплаты = С. Я пытался: shipping_method(A)=flat.flat payment method(C)=cod ...catalog/controller/checkout/payment.php if($this->request->post['shipping_method']=="flat.flat"){ if($this->request->post['payment_method']=="cod"){ $json['error']['warning'] = "Error !!!"; }} Это не работает! Спасибо за помощь!
Было бы наглядней если бы Вы расшифровали доставки и оплату. К примеру, если доставка - это самовывоз и доставка по городу, а оплата - наличными курьеру Возможно, возникли бы способы не лезть в код, а решить имеющимися средствами. Как ещё один вариант не лезть в код - поставить Simple Можно связать как угодно оплату и доставку, при выборе варианта А способ оплаты С просто не будет показываться. И другие полезные плюшки.
спасибо за ответ! если это возможно, я хотел бы решить "IF" функция Самое интересное было то, что shipping.php работать в аналогичных кодексов: if($this->request->post['shipping_method']=="flat.flat"){ if($this->request->post['comment']==""){ $json['error']['warning'] = "Warning: no comment!"; }} payment.php сайт не работает Это не может быть сделано условно [payment_method] на
v1.5.1.3 Meanwhile I made a kind of solution on catalog/view/theme/*/template/checkout/confirm.tpl <?php if ($data['shipping_method']=="methodA ") { ?> <?php if ($data['payment_method']=="methodC"){ ?> <?php echo "Error!"; ?> <?php }} ?> Of course, I’m waiting for any other suggestion. Thank you!
Are you sure inside $this->request->post['shipping_method'] and $this->request->post['payment_method'] is what you expected? Show me the full code from /catalog/controller/checkout/payment.php and /catalog/controller/checkout/shipping.php (as example if there it works).
Currently this condition is working on /catalog/controller/checkout/shipping.php ( the shipping address is already writed into the comment field or not) if($this->request->post['shipping_method']=="pickpack.pickpack"){ if($this->request->post['comment']==""){ $json['error']['warning'] = "Error: Please write the shipping address!"; }} I would like to expand this method on payment.php , where would be checking the shipping method and the payment method in the same time: if($this->request->post['shipping_method']=="pickpack.pickpack"){ if($this->request->post['payment_method']=="cod"){ $json['error']['warning'] = "Error: Payment method is not correct with this shipping method!"; }} This solution would be better than the confirm.tpl code ( echo only) because the json warning don’t let the next checkout step...
I need the full code of this two files. Otherwise I won't be able understand why it works in one and doesn't in another.
You can use tag "hide" to hide your content from unregistered users. For example (you need remove spaces in brackets): [ hide ]Content[ /hide ]