Jump to content
  • разработка интернет магазинов на opencart
  • доработка интернет магазинов на opencart

Помогите с модификацией для встраивания янгдекс этолей


Recommended Posts

Помогите пожалуйси запустить модификатор

 

Вот икой кусок кода нашел на просторах инеи:

<?xml version="1.0" encoding="utf-8"?>
<modification>
    <id>Параметры интернет-магазинов - Янгдекс метрика</id>
    <code>yandexcode</code>    
    <version>0.1</version>
    <vqmver>1.0.9</vqmver>
    <author>MUMU</author>

    <file name="catalog/controller/checkout/success.php">
        <operation>
                <ignoreif><![CDATA[
                    $this->data['order_id'] = $this->session->data['order_id'];
                    ]]></ignoreif>
        <search position="after"><![CDATA[
                if (isset($this->session->data['order_id'])) {
            ]]></search>
            <add><![CDATA[
            $this->data['order_id'] = $this->session->data['order_id'];
                        $this->data['store_name'] = $this->config->get('config_name');

                        $this->load->model('account/order');
                        $this->data['order_info'] = $this->model_account_order->getOrder($this->session->data['order_id']);

                        $this->data['order_products'] = $this->model_account_order->getOrderProducts($this->session->data['order_id']);

                        $tax = 0;
                        foreach($this->data['order_products'] as $row){
                            $tax = $tax + $row['tax'];
                        }
                        $this->data['tax'] = $tax;
            ]]></add>
        </operation>
    </file>

    <file name="catalog/view/theme/moneymaker2/template/common/success.tpl">
        <operation>
            <search position="before"><![CDATA[
                <?php echo $footer; ?>
            ]]></search>
            <add><![CDATA[
            <?php if(isset($order_id) && $order_id) { ?>
    <script type="text/javascript">

        var yaParams = {
                order_id: "<?php echo $order_id; ?>",
                order_price: <?php echo  round($order_info["total"]); ?>, 
                currency: "<?php echo $order_info["currency_code"]; ?>",
                exchange_rate: 1,
                goods: []
        };
       
        <?php foreach ($order_products as $i=>$row) { ?>
            yaParams.goods[<?php echo $i; ?>] = {
                        id: "<?php echo $row["order_product_id"]; ?>", 
                        name: "<?php echo htmlentities($row['name'],ENT_COMPAT,'UTF-8'); ?>", 
                        price: "<?php echo  round($row["price"]); ?>",
                        quantity: "<?php echo $row["quantity"]; ?>"
                      } 
        <?php } ?>                     

    </script>
    <?php } ?>
            ]]></add>
        </operation>
    </file>    

</modification>

Moneymaker2 понятно для моего шаблона, а ик default было

 

Засунул его в xml файлик дал кодировку UTF8 без BOM и OC 2.3 дает ошибку Неправильный тип файла!

 

Как посивить его? Хотя бы запустить, посмотреть как рилииет)) Грит не верный файл...

Edited by Valirius
Link to comment
Share on other sites


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
 Share

×
×
  • Create New...

Important Information

On our site, cookies are used and personal data is processed to improve the user interface. To find out what and what personal data we are processing, please go to the link. If you click "I agree," it means that you understand and accept all the conditions specified in this Privacy Notice.