From 2a160422d9174f27c0265967d035cd039cda0802 Mon Sep 17 00:00:00 2001 From: Marion Muszynski Date: Wed, 27 Apr 2016 16:11:19 +0200 Subject: [PATCH] adding desc more for product --- adm/tabs/AdminProducts.php | 11 ++++++++ override/classes/Product.php | 52 ++++++++++++++++++++++++++++++++++++ themes/site/css/style.css | 37 +++++++++++++++++++++++-- themes/site/product.tpl | 39 ++++++++++++++++++--------- 4 files changed, 125 insertions(+), 14 deletions(-) diff --git a/adm/tabs/AdminProducts.php b/adm/tabs/AdminProducts.php index 25db68bd..b8cd7f9e 100755 --- a/adm/tabs/AdminProducts.php +++ b/adm/tabs/AdminProducts.php @@ -3275,6 +3275,17 @@ class AdminProducts extends AdminTab
+ + '.$this->l('More description:').'

('.$this->l('appears in the product lists and on the top of the product page').') + '; + foreach ($this->_languages as $language) + echo '
+ +
'; + echo ' + + +
'.$this->l('Short description:').'

('.$this->l('appears in the product lists and on the top of the product page').') '; diff --git a/override/classes/Product.php b/override/classes/Product.php index 6feeecd5..86693b52 100644 --- a/override/classes/Product.php +++ b/override/classes/Product.php @@ -1,6 +1,58 @@ 'isGenericName', 'meta_keywords' => 'isGenericName', + 'meta_title' => 'isGenericName', 'link_rewrite' => 'isLinkRewrite', 'name' => 'isCatalogName', + 'description' => 'isString', 'description_short' => 'isString', 'available_now' => 'isGenericName', 'available_later' => 'IsGenericName', + 'description_more' => 'isString'); + + /** + * @Override + * Check then return multilingual fields for database interaction + * + * @return array Multilingual fields + */ + public function getTranslationsFieldsChild() + { + self::validateFieldsLang(); + + $fieldsArray = array('meta_description', 'meta_keywords', 'meta_title', 'link_rewrite', 'name', 'available_now', 'available_later'); + $fields = array(); + $languages = Language::getLanguages(false); + $defaultLanguage = Configuration::get('PS_LANG_DEFAULT'); + foreach ($languages as $language) + { + $fields[$language['id_lang']]['id_lang'] = $language['id_lang']; + $fields[$language['id_lang']][$this->identifier] = (int)($this->id); + $fields[$language['id_lang']]['description'] = (isset($this->description[$language['id_lang']])) ? pSQL($this->description[$language['id_lang']], true) : ''; + $fields[$language['id_lang']]['description_short'] = (isset($this->description_short[$language['id_lang']])) ? pSQL($this->description_short[$language['id_lang']], true) : ''; + $fields[$language['id_lang']]['description_more'] = (isset($this->description_more[$language['id_lang']])) ? pSQL($this->description_more[$language['id_lang']], true) : ''; + foreach ($fieldsArray as $field) + { + if (!Validate::isTableOrIdentifier($field)) + die(Tools::displayError()); + + /* Check fields validity */ + if (isset($this->{$field}[$language['id_lang']]) AND !empty($this->{$field}[$language['id_lang']])) + $fields[$language['id_lang']][$field] = pSQL($this->{$field}[$language['id_lang']]); + elseif (in_array($field, $this->fieldsRequiredLang)) + { + if ($this->{$field} != '') + $fields[$language['id_lang']][$field] = pSQL($this->{$field}[$defaultLanguage]); + } + else + $fields[$language['id_lang']][$field] = ''; + } + } + return $fields; + } /** * @Override diff --git a/themes/site/css/style.css b/themes/site/css/style.css index 526aed7e..0eb512ca 100755 --- a/themes/site/css/style.css +++ b/themes/site/css/style.css @@ -5755,6 +5755,11 @@ div#giftvoucher_ask_infos_block .gv_customization > .gv_param input { background-position: -5px; padding-left: 55px; } +#sale_end #countdown { + clear: both; + color: #fb66a9; + float: left; +} #product #short_description_block { padding: 0px 20px 0px 20px; width: 100%; @@ -5812,12 +5817,40 @@ div.form-right{ padding-top: 10px; text-align: right; } -#product #short_description_block #short_description_content { +#product #short_description_block #more_description_content{ + margin-top: 20px; +} +#product #short_description_block #more_description_content p { + font-size: 12px; + line-height: 1.5em; + margin-bottom: 10px; + color: #444d52; width: 100%; margin-left: 5px; text-align: justify; } - +#product #more_info_block { + clear: both; + padding: 10px 15px 20px 20px; +} +#product #more_info_block .idTabs li{ + position: relative; + margin-left: 1px; + line-height: 12px; +} +#product #more_info_block .idTabs li a { + background: #fb66a9; + color: #fff; +} +#product #more_info_block .idTabs li a.selected { + font-weight: bold; + background: #F3F3F3; + color: #fb66a9; +} +#product .sheets { + padding: 20px 0px; + background: #F3F3F3; +} @keyframes slideInDown { 0% { diff --git a/themes/site/product.tpl b/themes/site/product.tpl index 3d485ac2..2a92d020 100755 --- a/themes/site/product.tpl +++ b/themes/site/product.tpl @@ -214,7 +214,7 @@ var fieldRequired = '{l s='Please fill in all required fields, then save the cus - {if $product->description_short OR $packItems|@count > 0} + {if $product->description_more OR $packItems|@count > 0}
{*{if $product->description} @@ -389,9 +389,10 @@ var fieldRequired = '{l s='Please fill in all required fields, then save the cus
+
{/if} - {if $product->description_short} -
{$product->description_short}
+ {if $product->description_more} +
{$product->description_more}
{/if}
{/if} @@ -416,20 +417,37 @@ var fieldRequired = '{l s='Please fill in all required fields, then save the cus - {if $product->description || $features || $accessories || $HOOK_PRODUCT_TAB || $attachments} + {if $product->description_short || $product->description || $features || $accessories || $HOOK_PRODUCT_TAB || $attachments}
- {if $product->description} + {if $product->description_short}
- -
+ {$product->description_short} +
+ {/if} + {if $product->description} + +
+ {$product->description} +
+ {/if} +
+
+
+
+
{if $sale->delivery_delay == 2 || $sale->delivery_delay == 3 @@ -455,9 +473,6 @@ var fieldRequired = '{l s='Please fill in all required fields, then save the cus {l s='Paypal & CB'}
- - {$product->description}
- {/if} {if $features}