Electro Web IT
Electro Web IT

Reputation: 17

Prestashop different content b2b

I need the code that allows you to view different content from the b2b shop to the retail shop. version prestashop 1.7.3

Example:

{if $shop_id == "2"}

content... {/if}

but this doesn't work. someone help me? thanks

Upvotes: 1

Views: 135

Answers (2)

Marcin Jaworski
Marcin Jaworski

Reputation: 340

Context::getContext()->shop->id

This is not for B2B settings, but for multistore feature. For B2B is:

if (Configuration::get('PS_B2B_ENABLE')) {

Upvotes: 0

ventura
ventura

Reputation: 174

You have several options to do so. It would be best to create a global variable in the header hook so that you can use it throughout the frontend. You can also do it like this.

{ if Context::getContext()->shop->id = 2}

Upvotes: 0

Related Questions