Jump to content
Search In
  • More options...
Find results that contain...
Find results in...

Как сделать название товара ссылкой в письме админа?


Recommended Posts

13 минут назад, spectre сказал:

редактировать шаблон письма и model/checkout/order

добавить в массив ссылку, в шаблоне вывести

Ето понятно,а можна сам код?,

 

Так как сделал чтоб выводило оддельно самую ссылку на товар, а вот название товара было уже ссылкой ето проблема!

 

 

//вывод оддельно самой ссылки на товар
                $linksToProducts .= "<br/>" . $this->url->link('product/product', 'product_id=' .$order_product['product_id']);
            }

// Text
        
                $text  = $language->get('text_new_received') . "<br/><br/>";
                $text .= $language->get('text_new_order_id') . ' ' . $order_id . "<br/>";
                $text .= $language->get('text_new_date_added') . ' ' . date($language->get('date_format_short'), strtotime($order_info['date_added'])) . "<br/>";
                $text .= $language->get('text_new_order_status') . ' ' . $order_status . "<br/><br/>";
                $text .= $language->get('text_new_products') . "<br/><br/>";
                
            
            
                
                foreach ($order_product_query->rows as $product) 
                {
                    $text .= $product['quantity'] . 'x ' . $product['name'] . ' (' . $product['model'] . ') ' . html_entity_decode($this->currency->format($product['total'] + ($this->config->get('config_tax') ? ($product['tax'] * $product['quantity']) : 0), $order_info['currency_code'], $order_info['currency_value']), ENT_NOQUOTES, 'UTF-8') . "<br/>";
                    $order_option_query = $this->db->query("SELECT * FROM " . DB_PREFIX . "order_option WHERE order_id = '" . (int)$order_id . "' AND order_product_id = '" . $product['order_product_id'] . "'");
                    
                    foreach ($order_option_query->rows as $option) {
                        if ($option['type'] != 'file') {
                            $value = $option['value'];
                        } else {
                            $value = utf8_substr($option['value'], 0, utf8_strrpos($option['value'], '.'));
                        }

                        $text .= chr(9) . '-' . $option['name'] . ' ' . (utf8_strlen($value) > 20 ? utf8_substr($value, 0, 20) . '..' : $value) . "\n";
                    }
                }
                
            
                $text .= $linksToProducts;
                foreach ($order_voucher_query->rows as $voucher) {
                    $text .= '1x ' . $voucher['description'] . ' ' . $this->currency->format($voucher['amount'], $order_info['currency_code'], $order_info['currency_value']);
                }

            

                
                $text .= "<br/><br/>";

Link to comment
Share on other sites


27 минут назад, spectre сказал:

редактировать шаблон письма и model/checkout/order

добавить в массив ссылку, в шаблоне вывести

Если не трудно помогите решить проблему,буду очень Благодарен

Link to comment
Share on other sites


Замените первую строку в начале цикла foreach на эту:

$text .= $product['quantity'] . 'x <a href="' . $this->url->link('product/product', 'product_id=' .$product['product_id']) . '">' . $product['name'] . '</a> (' . $product['model'] . ') ' . html_entity_decode($this->currency->format($product['total'] + ($this->config->get('config_tax') ? ($product['tax'] * $product['quantity']) : 0), $order_info['currency_code'], $order_info['currency_value']), ENT_NOQUOTES, 'UTF-8') . "<br/>";
Link to comment
Share on other sites


47 минут назад, ZeroHero сказал:

Замените первую строку в начале цикла foreach на эту:


$text .= $product['quantity'] . 'x <a href="' . $this->url->link('product/product', 'product_id=' .$product['product_id']) . '">' . $product['name'] . '</a> (' . $product['model'] . ') ' . html_entity_decode($this->currency->format($product['total'] + ($this->config->get('config_tax') ? ($product['tax'] * $product['quantity']) : 0), $order_info['currency_code'], $order_info['currency_value']), ENT_NOQUOTES, 'UTF-8') . "<br/>";

БОЛЬШОЕ СПАСИБО!!!!!!!!!!!!!!!!!!!!

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.