Jump to content

Personnalisation produit


Johan30260

Recommended Posts

@Johan30260

Bonne journée.
Des informations supplémentaires doivent être fournies.
1. ère version de Prestashop
2. s'il y aura un affichage limité pour tous les produits et champs personnalisables

 

Dans l’exemple, cela ressemblerait à ceci.
Modifiez le fichier ./themes/theme/catalog/product.tpl.


1. Trouvez la condition

{if $product.is_customizable && count($product.customizations.fields)}

2. créez une variable pour les groupes de clients et placez-la au-dessus du point 1.

(3,4,5) = ID du groupe de clients

{assign var=enableCustomizationCustomerGroup value=(array(3,4,5))}

3. modifier la condition du point 1.

{if $product.is_customizable && count($product.customizations.fields) && in_array($customer.id_default_group, $enableCustomizationCustomerGroup)}

4. En conséquence, cela se passerait comme ça

{assign var=enableCustomizationCustomerGroup value=(array(3,4,5))}
{if $product.is_customizable && count($product.customizations.fields) && in_array($customer.id_default_group, $enableCustomizationCustomerGroup)}
	{block name='product_customization'}
		{include file="catalog/_partials/product-customization.tpl" customizations=$product.customizations}
	{/block}
{/if}

 

Edited by ps8modules.com (see edit history)
Link to comment
Share on other sites

Bonjour, merci pour votre retour.

Dans un premier temps, je suis sous 1.7.6.8

 

L'idée est que nous vendons des pièces détachées pour du b2b et b2c, et nous avons besoin que pour l'affichage b2c, il y est la personnalisation du produit sur la fiche produit. Mais elle ne doit pas être visible sur la page produit b2c.

 

Cette modification doit être, pour l'ensemble de notre catalogue, ± 16 000 références.

 

Merci pour votre aide et votre retour.

 

Link to comment
Share on other sites

{**

2007-2020 PrestaShop SA and Contributors



NOTICE OF LICENSE



This source file is subject to the Academic Free License 3.0 (AFL-3.0)

that is bundled with this package in the file LICENSE.txt.

It is also available through the world-wide-web at this URL:



If you did not receive a copy of the license and are unable to

obtain it through the world-wide-web, please send an email

to [email protected] so we can send you a copy immediately.



DISCLAIMER



Do not edit or add to this file if you wish to upgrade PrestaShop to newer

versions in the future. If you wish to customize PrestaShop for your

needs please refer to   for more information.



@‌author    PrestaShop SA [email protected]

@‌copyright 2007-2020 PrestaShop SA and Contributors

@‌license     Academic Free License 3.0 (AFL-3.0)

International Registered Trademark & Property of PrestaShop SA*}{extends file=$layout}

{block name='head_seo' prepend}
<link rel="canonical" href="{$product.canonical_url}">
{/block}

{block name='head' append}
<meta property="og:type" content="product">
<meta property="og:url" content="{$urls.current_url}">
<meta property="og:title" content="{$page.meta.title}">
<meta property="og:site_name" content="{$shop.name}">
<meta property="og:description" content="{$page.meta.description}">
<meta property="og:image" content="{$product.cover.large.url}">
{if $product.show_price}
<meta property="product:pretax_price:amount" content="{$product.price_tax_exc}">
<meta property="product:pretax_price:currency" content="{$currency.iso_code}">
<meta property="product:price:amount" content="{$product.price_amount}">
<meta property="product:price:currency" content="{$currency.iso_code}">
{/if}
{if isset($product.weight) && ($product.weight != 0)}
<meta property="product:weight:value" content="{$product.weight}">
<meta property="product:weight:units" content="{$product.weight_unit}">
{/if}
{/block}

{block name='content'}
<section itemscope itemtype="https://schema.org/Product ">

{block name='main_product_details'}
<div class="main-product-details shadow-box md-bottom" id="mainProduct">
{assign var='hook_product_3rd_column' value={hook h='displayProduct3rdColumn'}}
{if strpos($hook_product_3rd_column, 'data-key-zone-product-extra-fields') == false}
{assign var='hook_product_3rd_column' value=false}
{/if}

  <div class="row">
    {block name='product_left'}
      <div class="product-left col-12 col-md-5 {if $hook_product_3rd_column}col-xl-4{/if}">
        <section class="product-left-content">
          {block name='product_cover_thumbnails'}
            {include file='catalog/_partials/product-cover-thumbnails.tpl'}
          {/block}

          {hook h='displayAfterProductThumbs2'}

          {block name='product_flags'}
            {include file='catalog/_partials/product-flags.tpl'}
          {/block}
        </section>
      </div>
    {/block}

    {block name='product_right'}
      <div class="product-right col-12 col-md-7 {if $hook_product_3rd_column}col-xl-8{/if}">
        <section class="product-right-content">
          {block name='page_header_container'}
            {block name='page_header'}
              <h1 class="page-heading" itemprop="name">{block name='page_title'}{$product.name}{/block}</h1>
            {/block}
          {/block}

          <div class="row">
            <div class="col-12 {if $hook_product_3rd_column}col-xl-8{/if}">
              <div class="product-attributes mb-2 js-product-attributes-destination"></div>

              <div class="product-availability-top mb-3 js-product-availability-destination"></div>

              {block name='product_out_of_stock'}
                <div class="product-out-of-stock">
                  {hook h='actionProductOutOfStock' product=$product}
                </div>
              {/block}

              {block name='product_description_short'}
                <div id="product-description-short-{$product.id}" class="product-description-short typo sm-bottom" itemprop="description">
                  {$product.description_short nofilter}
                </div>
              {/block}

              {include file='catalog/_partials/product-information.tpl'}

              {hook h="outofstock"}

              {block name='product_additional_info'}
                {include file='catalog/_partials/product-additional-info.tpl'}
              {/block}

              {hook h='displayProductAdditionalInfo2' product=$product}
            </div>

            {if $hook_product_3rd_column}
              <div class="col-12 col-xl-4">
                {$hook_product_3rd_column nofilter}
              </div>
            {/if}
          </div>

          {block name='hook_display_reassurance'}
            <div class="reassurance-hook">
              {hook h='displayReassurance'}
            </div>
          {/block}
        </section><!-- /product-right-content -->
      </div><!-- /product-right -->
    {/block}
  </div><!-- /row -->

  <div class="js-product-refresh-pending-query page-loading-overlay main-product-details-loading">
    <div class="page-loading-backdrop d-flex align-items-center justify-content-center">
      <span class="uil-spin-css"><span><span></span></span><span><span></span></span><span><span></span></span><span><span></span></span><span><span></span></span><span><span></span></span><span><span></span></span><span><span></span></span></span>
    </div>
  </div>
</div><!-- /main-product-details -->

{/block}

{block name='main_product_bottom'}
<div class="main-product-bottom md-bottom">
{if isset($zonevars) && $zonevars.product_info_layout == 'accordions'}
{include file='catalog/_partials/product-bottom-accordions.tpl'}
{elseif isset($zonevars) && $zonevars.product_info_layout == 'tabs'}
{include file='catalog/_partials/product-bottom-tabs.tpl'}
{else}
{include file='catalog/_partials/product-bottom-normal.tpl'}
{/if}
</div>
{/block}

{include file='catalog/_partials/product-accessories.tpl'}

{block name='product_footer'}
{if isset($category)}
{hook h='displayFooterProduct' product=$product category=$category}
{else}
{hook h='displayFooterProduct' product=$product}
{/if}
{/block}

{block name='product_images_modal'}
{include file='catalog/_partials/product-images-modal.tpl'}
{/block}
</section>
{/block}
{assign var=enableCustomizationCustomerGroup value=(array(12))}
{if $product.is_customizable && count($product.customizations.fields) && in_array($customer.id_default_group, $enableCustomizationCustomerGroup)}
	{block name='product_customization'}
		{include file="catalog/_partials/product-customization.tpl" customizations=$product.customizations}
	{/block}

Merci

Link to comment
Share on other sites

Hehe, j'y ai bien pensé, pourtant de mon coté, la modification n'est pas prise en compte, voici 2 capture d'ecran, l'une avec le groupe de client "Client" ou la personnalisation ne doit pas être visible, et la deuxieme "VIP" ou la personnalisation doit etre visible, elle l'est.

 

Merci 😜

 

Capture 1.PNG

capture 2.PNG

Link to comment
Share on other sites

Wow, et vous ça marche..

Qu'avez vous mis dans ce code 

  {assign var=enableCustomizationCustomerGroup value=(array(12))}

Moi le 12 correspond à mon ID client, celui pour lequel la personnalisation doit etre visible, donc ID entre 0 et 11 elle ne doit pas l'etre

 

Je suis sous PS 1.7.6.8

Edited by Johan30260 (see edit history)
Link to comment
Share on other sites

Je vous ai proposé une édition gratuite.
Malheureusement, vous ne l'avez pas accepté et je ne peux plus vous conseiller.
Ce que j'ai suggéré.
Si vous ne savez pas quoi faire, je le mets sur la table et il se fige.
Il est également fort possible que votre modèle utilise plusieurs mises en page possibles.
Mais qu’en est-il des détails détaillés du produit ?
Je ne t'aiderai pas de toute façon !!!

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...