- Posts: 34
- Thank you received: 0
Personalized product page in show.php
- co88agency
-
Topic Author
- Offline
-- Joomla version -- : 3.4.4
-- PHP version -- : 5.5.29
Hello everyone,
I would like to display an image at the bottom of product page only in a specific category product.
I put this code in show.php:
The fact is that it does not work and I do not understand why ... the image is displayed in every product, even in those who do not belong to the category "Partecipazioni".
Can anyone help me out?
Thank you and best regards,
Loredana
Please Log in or Create an account to join the conversation.
- Posts: 12953
- Thank you received: 1778
Using that kind of code through the "Show" file of the "Product" view of your front-end template via "Hikashop->Display->Views" will probably do the job :
Please Log in or Create an account to join the conversation.
- co88agency
-
Topic Author
- Offline
- Posts: 34
- Thank you received: 0
Unfortunately it returns me an error... Complete code is:
What is wrong?
Thanks and best regards,
Loredana
Please Log in or Create an account to join the conversation.
Please give us more details about the returned error.
This is maybe due to the "}" present before: $this->setLayout('show_block_custom_item');
Please Log in or Create an account to join the conversation.
- co88agency
-
Topic Author
- Offline
- Posts: 34
- Thank you received: 0
Thanks and best regards,
Loredana
Please Log in or Create an account to join the conversation.
- Posts: 12953
- Thank you received: 1778
Your issue is coming from your last 3 lines, you should replace these lines :
Please Log in or Create an account to join the conversation.
- co88agency
-
Topic Author
- Offline
- Posts: 34
- Thank you received: 0
The error is changed...
It's on lline 923...
Thank you very very much for your support...
Please Log in or Create an account to join the conversation.
You have to add another "}" right after the latest one in your code.
Please Log in or Create an account to join the conversation.
- co88agency
-
Topic Author
- Offline
- Posts: 34
- Thank you received: 0
Best regards,
Loredana
Please Log in or Create an account to join the conversation.
- Posts: 12953
- Thank you received: 1778
Then a solution can be to just check what you have on the $this->element->product_category_id variable to see if the category which have the ID number 40 is correctly called.
Using that php code will display the value of that variable for example :
echo 'Category ID : ' . $this->element->product_category_id;
Please Log in or Create an account to join the conversation.
- co88agency
-
Topic Author
- Offline
- Posts: 34
- Thank you received: 0
Thank you very very very much... thank you thank you thank you...
Best regards,
Loredana
Please Log in or Create an account to join the conversation.
- co88agency
-
Topic Author
- Offline
- Posts: 34
- Thank you received: 0
Category number change costantly... why? How can I do?
Best regards,
Loredana
Please Log in or Create an account to join the conversation.
What is a category number ?
What does "category number change constantly" mean ?
Regards,
Jerome - Obsidev.com
HikaMarket & HikaSerial developer / HikaShop core dev team.
Please Log in or Create an account to join the conversation.
- co88agency
-
Topic Author
- Offline
- Posts: 34
- Thank you received: 0
Regards,
Loredana
Please Log in or Create an account to join the conversation.
Please Log in or Create an account to join the conversation.
- co88agency
-
Topic Author
- Offline
- Posts: 34
- Thank you received: 0
Thank you and best regards,
Loredana
Please Log in or Create an account to join the conversation.