Products
Názov
No changesPermalink
No changesObsah
| Old | New | ||
|---|---|---|---|
| 48 | The TARIC code (Integrated Tariff of the European Communities) can be | 48 | The TARIC code (Integrated Tariff of the European Communities) can be |
| 49 | used to specify product type when it comes to shipping and toll. | 49 | used to specify product type when it comes to shipping and toll. |
| 50 | 50 | ||
| 51 | External Link: [TARIC](http://en.wikipedia.org/wiki/Taric_code) | 51 | External Link: [TARIC](https://en.wikipedia.org/wiki/Taric_code) |
| 52 | External Link: [European Comission](http://ec.europa.eu/taxation_customs/dds2/taric/taric_consultation.jsp?Lang=en&Screen=0&Expand=true) | 52 | External Link: [European Comission](https://ec.europa.eu/taxation_customs/dds2/taric/taric_consultation.jsp?Lang=en&Screen=0&Expand=true) |
| 53 | 53 | ||
| 54 | ## Options | 54 | ## Options |
| 55 | 55 | ||
| 71 | $product->data['name'] = ['en' => 'Yellow Duck']; | 71 | $product->data['name'] = ['en' => 'Yellow Duck']; |
| 72 | $product->data['prices'] = ['USD' => 9.99]; | 72 | $product->data['prices'] = ['USD' => 9.99]; |
| 73 | $product->save(); | 73 | $product->save(); |
| 74 | ``` | ||
| 75 | |||
| 76 | ## Reference Model | ||
| 77 | |||
| 78 | ```php | ||
| 79 | echo reference::product($product_id)->name; | ||
| 80 | echo reference::product($product_id)->default_category->name; | ||
| 81 | echo reference::product($product_id)->manufacturer->name; | ||
| 82 | ``` | ||
| 83 | |||
| 84 | ## Database Query | ||
| 85 | |||
| 86 | ```php | ||
| 87 | $query = database::query( | ||
| 88 | "select p.id, pi.name, pp.`USD` as price from ". DB_TABLE_PREFIX ."products p | ||
| 89 | left join ". DB_TABLE_PREFIX ."products_info pi on (pi.product_id = p.id and pi.language_code = 'en') | ||
| 90 | left join ". DB_TABLE_PREFIX ."products_prices pp on (pp.product_id = p.id) | ||
| 91 | where p.id = ". (int)$product_id ." | ||
| 92 | limit 1;" | ||
| 93 | ); | ||
| 94 | |||
| 95 | $product = database::fetch($query); | ||
| 74 | ``` | 96 | ``` |
Edited by tim on 29 jan 2024 at 23:48