NOTE: Make all tests in advanced theme
== Prepare ==
1. Open modules/in-commerce/units/products/products_event_handler.php in text editor
2. Look for
```
lang=php, name=products_event_handler.php
public function getPassedID(kEvent $event)
{
```
3. Add code at the next line after `{`
```
lang=php, name=products_event_handler.php
if ( $event->Special == 'test' ) {
return $this->Conn->GetOne('SELECT ProductId FROM ' . TABLE_PREFIX . 'Products WHERE SKU = "test"');
}
```
4. Save file and close.
5. Open themes/advanced/in-commerce/elements/content_boxes/featured_products.elm.tpl in text editor
6. Add next code at the beginning of file:
```
lang=html, name=featured_open `themes/advanced/in-commerce/elements/products.elm.tpl` file for editing
<a href="<inp2:p.test_AddToCartLink template='in-commerce/checkout/shop_cart' product_template='__default__'/>" class="link-product2">Add test product to cart</a>2. in the `product_element` block above the line with `AddToCartLink` tag usage add `<inp2:m_Set {$PrefixSpecial}_id="1"/>` code
```3. save changes
== Testing ==
# Go to `Admin Console`, {nav Website & Content > Structure & Data > Products}.
# Switch to `Products tab`.
# Click `New Product` button to create new product, select `Tangible` in dropown.
# On `General` tab enter any value# Switch to `Title`, 'test' to `SKU` and select 'Active' in `Status` radiobuttonsthe `Products tab`.
# Go to `Pricing` tab.# Create a couple of the products, when there are none (goal is to have 2 products at least)
# Enter 10 to `Price`# Go to `Front-End`, {nav Products}.
# Click `Save` button to savon the `Buy now` link on 1st of the product.ts in the main list (right part of the page)
# Go to `Front-End`, {nav P# Confirm that you redirected to the shopping cart with your chosen products}. added
# Click on `Add test product to cart` link atthe `Buy now` link on 2nd of the products in the top of main content block.main list (right part of the page)
# Confirm that you redirected to the shopping cart with your testchosen product added.