Small product page modifications

  • Posts: 228
  • Thank you received: 8
11 years 2 weeks ago #168763

-- url of the page with the problem -- : gurtech.guywalderonline.com/index.php/%D...A7%D7%95%D7%99%D7%9C
-- HikaShop version -- : 2.3.2
-- Joomla version -- : 3.3.3
-- PHP version -- : 5.4.30
-- Browser(s) name and version -- : Chrome

Hi all,

I'm building a site for a client with some unique requests which I would like to provide. This is the first time I've been using HikaShop and so far so good. I've attached an image to make life easier. This are the changes I was asked to make:
1. Add a small text box with short product description in area 1.
2. Completely hide the price tab from products with no price - number 2.
3. Add another tab with more product images. Should I just do this with WYSIWYG custom field? No option to add a custom field for images? Number 3.




Thank you in advance,

Guy.

Attachments:

Please Log in or Create an account to join the conversation.

  • Posts: 13201
  • Thank you received: 2322
11 years 2 weeks ago #168771

Hi,

1. You will have to edit the view "product / show_tabular" and add some PHP code to display the a short description, something like:

echo JHTML::_('content.prepare',preg_replace('#<hr *id="system-readmore" */>#i','',substr($this->element->product_description,0,250)));
You can replace "250" by the desired value.

2. Add this kind of code:
if($this->element->prices[0] != 0)
Just after:
$this->setLayout('listing_price');

3. You can use custom fields to display images. To add a tab, you have to add a tab entry, a "li" and a "div" for the content.
Thanks to look how it is made, and just duplicate an entry and edit it as you wish.

Here is global documentation for all the css layout customizations:
hikashop.com/support/support/documentati...ize-the-display.html

Please Log in or Create an account to join the conversation.

  • Posts: 228
  • Thank you received: 8
11 years 2 weeks ago #168924

Hi Xavier,

Thank you for your help. The price solution was perfect and worked like a charm. Had to edit show_default.php (I guess it's a template override).

As for the pictures, I'm using the essential package so my custom fields are added automatically to the tabs. I will add the images in a WYSIWYG field.

As for the product short description, I've added the code right after the "characteristic_display" block and it works just fine. But, my client would like to add a text by himself and not have a subtext of the main product description. Can that be done?

Thank you again for your great help,

Guy.

Please Log in or Create an account to join the conversation.

  • Posts: 13201
  • Thank you received: 2322
11 years 2 weeks ago #168927

Hi,

Yes, you can create a custom field in the "product" table, this way the client can fill the desired informations in this field.
And in the view use:

<?php echo $this->element->CUSTOMFIELD_NAME; ?>

Please Log in or Create an account to join the conversation.

Time to create page: 0.077 seconds
Powered by Kunena Forum