Jump to content
  • 0

Znikneły gwiazdki recenzji w produkcie - POMOCY


plaxton

Question

Zniknęły mi gwiazdki recenzji na stronie produktu, z  wraz z textem {przeczytaj wszystkie recenzje} zostało gołe Napisz opinię

Opinie i gwiazdki  w product-tab działają, w miarę poprawnie wyświetlają się też w product-list.

Jest coś nie tak z zależnością {if $nbComments != 0} , bo po odblokowaniu wyświetlają się bloki

Używam zwykłego wbudowanego productcomment.

Presta 1.6.1.19

 

Problem pojawił się po zmianie w silniku presty. Chodziło o dodatkową opcje dla condition produktu. Zmiana funkcjonuje bez problemu ale wykasowała mi te gwiazki !

Po cofnięciu zmian i przeinstalowaniu modułu productcomment , wszystko wraca do normy.

Co ja tego zrobiłem w poniższych zmianach, żę ten moduł wariuje.

 

Serdecznie proszę o pomoc :-)


============= 1. 
\admin78467\themes\default\template\controllers\products\informations.tpl

(Linia 317)
ORG:
<select name="condition" id="condition">
<option value="new" {if $product->condition == 'new'}selected="selected"{/if} >{l s='New'}</option>
<option value="used" {if $product->condition == 'used'}selected="selected"{/if} >{l s='Used'}</option>
<option value="refurbished" {if $product->condition == 'refurbished'}selected="selected"{/if}>{l s='Refurbished'}</option>
</select>

ZAMIEŃ NA:
<select name="condition" id="condition">
<option value="new" {if $product->condition == 'new'}selected="selected"{/if} >{l s='New'}</option>
<option value="used" {if $product->condition == 'used'}selected="selected"{/if} >{l s='Used'}</option>
<option value="refurbished" {if $product->condition == 'refurbished'}selected="selected"{/if}>{l s='Refurbished'}</option>
<option value="damaged" {if $product->condition == 'damaged'}selected="selected"{/if}>{l s='Damaged'}</option>
</select>



========== 2.
\classes\Product.php

(Linia 181)
ORG:
/** @var enum Product condition (new, used, refurbished) */
    public $condition;


ZAMIEŃ NA:
/** @var enum Product condition (new, used, refurbished, damaged) */
    public $condition;

(Linia 291)
ORG:
'condition' =>                     array('type' => self::TYPE_STRING, 'shop' => true, 'validate' => 'isGenericName', 'values' => array('new', 'used', 'refurbished'), 'default' => 'new'),

ZAMIEŃ NA:
 'condition' =>                     array('type' => self::TYPE_STRING, 'shop' => true, 'validate' => 'isGenericName', 'values' => array('new', 'used', 'refurbished', 'damaged'), 'default' => 'new'),


========== 3.
\js\admin\products.js

(Linia 1093)
ORG:
tabs_manager.onLoad('Informations', function(){
                        $('#condition').attr('disabled', true);
                        $('#condition option[value=refurbished]').removeAttr('selected');
                        $('#condition option[value=used]').removeAttr('selected');
                    });

ZAMIEŃ NA:
tabs_manager.onLoad('Informations', function(){
                        $('#condition').attr('disabled', true);
                        $('#condition option[value=refurbished]').removeAttr('selected');
                        $('#condition option[value=used]').removeAttr('selected');
                        $('#condition option[value=damaged]').removeAttr('selected');
                    });


============== 4.
\modules\blocklayered\blocklayered.php

(Linia 1034)
ORG:
$condition_list = array(
                        'new' => $this->translateWord('New', (int)$filter['id_lang']),
                        'used' => $this->translateWord('Used', (int)$filter['id_lang']),
                        'refurbished' => $this->translateWord('Refurbished', (int)$filter['id_lang'])
                    );

ZAMIEŃ NA:
$condition_list = array(
                        'new' => $this->translateWord('New', (int)$filter['id_lang']),
                        'used' => $this->translateWord('Used', (int)$filter['id_lang']),
                        'refurbished' => $this->translateWord('Refurbished', (int)$filter['id_lang']),
                        'damaged' => $this->translateWord('Damaged', (int)$filter['id_lang'])
                    );

(Linia 1752)
ORG:
preg_match('/^(.*)_([0-9]+|new|used|refurbished|slider)$/', substr($key, 8, strlen($key) - 8), $res);

ZAMIEN NA:
preg_match('/^(.*)_([0-9]+|new|used|refurbished|damaged|slider)$/', substr($key, 8, strlen($key) - 8), $res);

(Linia 1760)
ORG:
if ($res[1] == 'condition' && in_array($value, array('new', 'used', 'refurbished')))

ZAMIEŃ NA:
if ($res[1] == 'condition' && in_array($value, array('new', 'used', 'refurbished', 'damaged')))

(Linia 2438)
ORG:
$condition_array = array(
                        'new' => array('name' => $this->l('New'),'nbr' => 0),
                        'used' => array('name' => $this->l('Used'), 'nbr' => 0),
                        'refurbished' => array('name' => $this->l('Refurbished'),'nbr' => 0)
                    );

ZAMIEŃ NA:
 $condition_array = array(
                        'new' => array('name' => $this->l('New'),'nbr' => 0),
                        'used' => array('name' => $this->l('Used'), 'nbr' => 0),
                        'refurbished' => array('name' => $this->l('Refurbished'), 'nbr' => 0),
                        'damaged' => array('name' => $this->l('Damaged'), 'nbr' => 0)
                    );

============= 5.
\themes\default-bootstrap\product.tpl

(Linia 168)
ORG:
capture name=condition}
                {if $product->condition == 'new'}{l s='New'}
                {elseif $product->condition == 'used'}{l s='Used'}
                {elseif $product->condition == 'refurbished'}{l s='Refurbished'}
                {/if}
            {/capture}

ZAMIEŃ NA:
{capture name=condition}
                {if $product->condition == 'new'}{l s='New'}
                {elseif $product->condition == 'used'}{l s='Used'}
                {elseif $product->condition == 'refurbished'}{l s='Refurbished'}
                {elseif $product->condition == 'damaged'}{l s='Damaged'}
                {/if}
            {/capture}


========== 6. BAZY DANYCH - dwie zmiany !
phpmyadmin/sql

A.
ALTER TABLE `ps_product` CHANGE `condition` `condition` ENUM( 'new', 'used', 'refurbished', 'damaged' ) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL DEFAULT 'new'


B.
ALTER TABLE `ps_product_shop` CHANGE `condition` `condition` ENUM( 'new', 'used', 'refurbished', 'damaged' ) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL DEFAULT 'new'















 

Link to comment
Share on other sites

0 answers to this question

Recommended Posts

There have been no answers to this question yet

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...