Thursday, 28 July 2016

Product Condition (Add/delete/rename) Prestashop 1.5+

Product Condition Prestashop 1.6+

 In the Prestashop v 1.5+, when we insert a new product, there is the possibility to set the product condition. There are 3 condition: new, used, refurbished.  

Can we add, delete or rename the conditions?

I found about the ENUM value in the "ps_product" database table and in some file of the admin controllers and in product classes.

solution in PS 1.6.1.4

1. edit in db enum - table ps_product_shop & ps_product row condition
2. in ~/admin/themes/default/temlapte/controller/products/informations.tpl
3. in ~/themes/you_theme_name/product.tpl
4. in ~/classes/Product.php
5. in ~/modules/blocklayered/blocklayered.php

==================================

you have to modify product.tpl file located in your theme directory, there is a code like:
{capture name=condition}     
{if isset($product.condition) && $product.condition=="new"}
    <div class="label-wrapper wrapper-new cls_new">
        <div class="label label-new">{l s='New' mod='jmsproductfilter'}</div>
    </div>  
{elseif isset($product.condition) && $product.condition == "pricedrop"}
    <div class="label-wrapper wrapper-new cls_pricedrop">
        <div class="label label-new">{l s='Price Drop!' mod='jmsproductfilter'}</div>
    </div>  
 {elseif isset($product.condition) && $product.condition == "bestvalue"}
    <div class="label-wrapper wrapper-new cls_bestvalue">
        <div class="label label-new">{l s='Best Value!' mod='jmsproductfilter'}</div>
    </div>
  {elseif isset($product.condition) && $product.condition == "latest"}
    <div class="label-wrapper wrapper-new cls_latest">
        <div class="label label-new">{l s='Latest' mod='jmsproductfilter'}</div>
    </div>
 {elseif isset($product.condition) && $product.condition == "dailyshiping"}
    <div class="label-wrapper wrapper-new cls_dailyshiping">
        <div class="label label-new">{l s='Daily Shipping' mod='jmsproductfilter'}</div>
    </div>
 {elseif isset($product.condition) && $product.condition == "onstock"}
    <div class="label-wrapper wrapper-new cls_onstock">
        <div class="label label-new">{l s='On Stock' mod='jmsproductfilter'}</div>
    </div>                             
{/if}

No comments:

Post a Comment