Instructions for configuring the «Add to cart» button.
Turbo pages can display the Add to cart button. It opens a desktop or mobile version of the shopping cart page that shows the added product.
To configure the button, select your CMS:
- In Yandex.Webmaster, go to.
- Enable the Add to cart option.
- Select CMS: 1C-Bitrix from the list.
The URL is generated automatically:
{offer_url}&action=BUY&id={offer_id}
{offer_url} — Link to the product page on the site specified in the YML file (the url element).
{offer_id} — The offer ID specified in the YML file (the ID attribute of the offer element).
- Click and check if the button works on the sample Turbo page. The Add to cart button should open your site shopping cart with the product inside.
If it doesn't, set up a redirect to the cart page from the page the button opens. For example, using a free plugin.
- In 1C-Bitrix, go to the Add.and click
- In the Start page field, specify the cart page that should open after clicking the Add to cart button. For example, /personal/basket.php.
- In the End page, specify the shopping cart page on your site. For example, /personal/cart/.
- Turn on the Activity option.
- Save the settings.
Example redirect configuration - (Optional) Set up conversion tracking using Yandex.Metrica goals.
- Install the plugin on the site. It is needed in order for the Add to cart button to work correctly on Turbo pages.
- After you install it, open thepage in Yandex.Webmaster.
- Enable the Add to cart option.
- Choose CMS: OpenCart from the list.The URL is generated automatically:
/index.php?route=product/product/addtocart&product_id={offer_id}
{offer_id} — The offer ID specified in the YML file (the ID attribute of the offer element).
- Click.
- Check if the shopping cart works on the sample Turbo page.
- (Optional) Set up conversion tracking using Yandex.Metrica goals.
- In Yandex.Webmaster, go to.
- Enable the Add to cart option.
- Choose Other from the list.
Create a URL for adding the product in the cart. Use the site address and the {offer_id} variable in the link. The variable will take the id attribute value (the offer element) from the YML file.
For example, https://mysite.com/cart?id={offer_id}.
You will need to modify the site:
- A GET request with the product ID will be sent to the site. You need to add this product to the basket and show it.
- Enter the link to the handler. In the link, use the {offer_id} variable, it will be replaced with the item ID (offer ID in YML).
- Click and check if the button works on the sample Turbo page. The Add to cart button should open your site shopping cart with the product inside.If it doesn't, set up a redirect to the cart page from the page the button opens.
- Set up a redirect to the shopping cart page with the WooCommerce plugin.
- In Yandex.Webmaster, enter the http://example.com/?add-to-cart={offer_id} URL in the field.
Example: configuring the button with WordPress - (Optional) Set up conversion tracking using Yandex.Metrica goals.