Edit Product

Code

Code is your internal reference id. It could be a product id in another
system. You decide. This is an alternative to SKU and UPC.

Manufacturer

Can be used for vendor or brand.

Supplier

Can be used for the company supplying you with the product. Convenient
for reports or drop shipping solutions.

Keywords

Keywords are used internally, among other things, to display similar
products. Keywords can be comma separated.

Head Title

The head title is the title of the page displayed in Google search
results. If blank it will display the product name.

META description

The meta description is the description of the page displayed in Google
search results. If blank it will display the product short description.

SKU

Stock Keeping Unit is the item id that refers to your product in stock.
SKU is also available for options (See options stock).

GTIN (UPC/EAN)

Universal Product Code can be used for your vendor's article number.
The term UPC is more common United States, Canada, the United Kingdom,
Australia, and New Zealand but can also be used for European Article
Number (EAN).

External Link: GTIN

TARIC

The TARIC code (Integrated Tariff of the European Communities) can be
used to specify product type when it comes to shipping and toll.

External Link: TARIC
External Link: European Comission

Options

Options lets your customers customize their product before adding it to the shopping cart.

Stock Options

A combination of product options that are bound to a it's own stock counting. First set up your product Options in the Options tab. Then you will be able to connect those to Stock Options e.g. Color: Red, Size: L.

Entity Object

// Initiate a new product
$product = new ent_product();

// Set english name
$product->data['name']['en'] = 'Yellow Duck';

// Set dollar price
$product->data['prices']['USD'] = 9.99;

// Add an attribute
$product->data['attributes'][] = [
  'group_id' => 11,
  'value_id' => 0,
  'custom_value' => 'Lorem ipsum',
];

// Add options
$product->data['options'][] = [
  'group_id' => 11,
  'function' => 'select',
  'required' => 1,
  'sort' => 'alphabetically'
  'values' => [
    [
      'value_id' => 22,
      'custom_value' => null,
      'price_operator' => '+',
      'USD' => 5.00
    ],
    [
      'value_id' => 0,
      'custom_value' => 'Lorem ipsum',
      'price_operator' => '+',
      'USD' => 0
    ],
  ],
  'priority' => 99,
];

$product->save();

Reference Model

echo reference::product($product_id)->name;
echo reference::product($product_id)->default_category->name;
echo reference::product($product_id)->manufacturer->name;

Database Query

$product = database::query(
  "select p.id, pi.name, pp.`USD` as price from ". DB_TABLE_PREFIX ."products p
  left join ". DB_TABLE_PREFIX ."products_info pi on (pi.product_id = p.id and pi.language_code = 'en')
  left join ". DB_TABLE_PREFIX ."products_prices pp on (pp.product_id = p.id)
  where p.id = ". (int)$product_id ."
  limit 1;"
)->fetch();

$products = database::query(
  "select p.id, pi.name, pp.`USD` as price from ". DB_TABLE_PREFIX ."products p
  left join ". DB_TABLE_PREFIX ."products_info pi on (pi.product_id = p.id and pi.language_code = 'en')
  left join ". DB_TABLE_PREFIX ."products_prices pp on (pp.product_id = p.id)
  order by pi.name;"
)->fetch_all();

Revisioni

Articoli modificati di recente
This website uses no cookies and no third party tracking technology. We think we can do better than others and really think about your privacy.