Jump to content

Edit History

jega

jega

Hi,

Presta 1.7.6.7

I have a additional product object (called 'condition_extra') which exists in 3 languages.

 

Now I have a problem:

I made a new column 'condition_extra' in the import document. When importing in a language the other languages are overwritten in the column ps_product_lang.

 

What I did:

a. Add a new column in ps_product_lang called 'condition_extra'

b. I made an override in override/controllers/admin/AdminImportController.php:

I added:

about line 78:

'condition_extra' => array('AdminImportController', 'createMultiLangField'),

about line 305:

'condition_extra' => array('label' => $this->l('Zustand Zusatz')),

about line 475:

'condition_extra' => array('AdminImportController', 'createMultiLangField'),

 

Can anybody help me to solve this problems?

Thanks

jega

jega

Hi,

Presta 1.7.6.7

I have a aditional product object (called 'condition_extra') which exists in 3 languages. The plan is to show it on invoice PDF.

Now I have 2 problems:

1. I managed to show the variable 'condition_extra' on invoice, but it is shown always in english (my third language). Cells from the column in ps_product_lang are ok (filled in manually).

2. I added a new column in the import document to import this 'condition_extra'. When importing in a language the other languages are overwritten.

 

What I did:

a. Add a new column in ps_product_lang called 'condition_extra'

b. I made an override in shop/override/classes/Product.php:

    public $condition_extra;
 
    public function __construct($id_product = null, $full = false, $id_lang = null, $id_shop = null, Context $context = null)
    {
        self::$definition['fields']['condition_extra'] = array('type' => self::TYPE_STRING, 'validate' => 'isGenericName', 'size' => 64, 'lang' => true);
        parent::__construct($id_product, $full, $id_lang, $id_shop, $context);
    }

c. I made an override in override/controllers/admin/AdminImportController.php:

I added:

about line 78:

'condition_extra' => array('AdminImportController', 'createMultiLangField'),

about line 305:

'condition_extra' => array('label' => $this->l('Zustand Zusatz')),

about line 475:

'condition_extra' => array('AdminImportController', 'createMultiLangField'),

d. Override in shop/override/classes/order/OrderInvoice.php:

public function getProductsDetail()
    {
        return Db::getInstance(_PS_USE_SQL_SLAVE_)->executeS('
        SELECT *
        FROM `' . _DB_PREFIX_ . 'order_detail` od
        LEFT JOIN `' . _DB_PREFIX_ . 'product` p
        ON p.id_product = od.product_id
        LEFT JOIN `'._DB_PREFIX_.'product_lang` pl
        ON pl.id_product = od.product_id
        LEFT JOIN `' . _DB_PREFIX_ . 'product_shop` ps ON (ps.id_product = p.id_product AND ps.id_shop = od.id_shop)
        WHERE od.`id_order` = ' . (int) $this->id_order . '
        ' . ($this->id && $this->number ? ' AND od.`id_order_invoice` = ' . (int) $this->id : '') . ' ORDER BY od.`product_name`');
    }

e. Add variable {$order_detail.condition_extra} in invoice.product-tab.tpl.

 

Can anybody help me to solve the problems?

Thanks

jega

jega

Hi,

Presta 1.7.6.7

I have a aditional product object (called 'condition_extra') which exists in 3 languages. The plan is to show it on invoice PDF.

Now I have 2 problems:

1. I managed to show the variable 'condition_extra' on invoice, but it is shown always in english (my third language). Cells from the column in ps_product_lang are ok (filled in manually).

2. I added a new column in the import document to import this 'condition_extra'. When importing in a language the other languages are overwritten.

 

What I did:

a. Add a new column in ps_product_lang called 'condition_extra'

b. I made an override in shop/override/classes/Product.php:

    public $condition_extra;
 
    public function __construct($id_product = null, $full = false, $id_lang = null, $id_shop = null, Context $context = null)
    {
        self::$definition['fields']['condition_extra'] = array('type' => self::TYPE_STRING, 'validate' => 'isGenericName', 'size' => 64, 'lang' => true);
        parent::__construct($id_product, $full, $id_lang, $id_shop, $context);
    }

c. I made an override in override/controllers/admin/AdminImportController.php:

I added:

about line 78:

'condition_extra' => array('AdminImportController', 'createMultiLangField'),

about line 305:

'condition_extra' => array('label' => $this->l('Zustand Zusatz')),

about line 475:

'condition_extra' => array('AdminImportController', 'createMultiLangField'),

d. Override in shop/override/classes/order/OrderInvoice.php:

public function getProductsDetail()
    {
        return Db::getInstance(_PS_USE_SQL_SLAVE_)->executeS('
        SELECT *
        FROM `' . _DB_PREFIX_ . 'order_detail` od
        LEFT JOIN `' . _DB_PREFIX_ . 'product` p
        ON p.id_product = od.product_id
        LEFT JOIN `'._DB_PREFIX_.'product_lang` pl
        ON pl.id_product = od.product_id
        LEFT JOIN `' . _DB_PREFIX_ . 'product_shop` ps ON (ps.id_product = p.id_product AND ps.id_shop = od.id_shop)
        WHERE od.`id_order` = ' . (int) $this->id_order . '
        ' . ($this->id && $this->number ? ' AND od.`id_order_invoice` = ' . (int) $this->id : '') . ' ORDER BY od.`product_name`');
    }

e. Add variable {$order_detail.condition_extra} in invoice.product-tab.tpl.

 

Can anybody help me to solve the problems?

Thanks

×
×
  • Create New...