Answer the question
In order to leave comments, you need to log in
Opencart. location. Forwarding?
Perhaps the question was not correctly posed. In general, there is a modifier that, instead of the basket, redirects to a link from the location field.
<modification>
<name>Location redirection</name>
<code>location-redirection</code>
<file path="catalog/controller/checkout/cart.php">
<operation>
<search><![CDATA[ if (!$json) {]]></search>
<add offset="0" position="before"><![CDATA[ $json['error'] = true;]]></add>
</operation>
<operation>
<search><![CDATA[$json['redirect'] = str_replace('&', '&', $this->url->link('product/product', 'product_id=' . $this->request->post['product_id']));]]></search>
<add offset="0" position="replase"><![CDATA[$json['redirect'] = $product_info['location'];]]></add>
</operation>
</file>
<file path="catalog/view/theme/default/template/product/product.tpl">
<operation>
<search><![CDATA[ $('.form-group').removeClass('has-error');]]></search>
<add offset="0" position="after"><![CDATA[
if (json['redirect']) {
location = json['redirect'];
} ]]></add>
</operation>
</file>
<file path="catalog/view/javascript/common.js">
<operation>
<search><![CDATA[location = json['redirect'];]]></search>
<add position="replace"><![CDATA[window.open(json['redirect']);]]></add>
</operation>
</file>
</modification>
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question