Skip to main content

Add a subname/Subtitle after product_name[SOLVED!]

10 years 5 months ago - 10 years 5 months ago #242299 by jackinthex
I want to show a subname/subtitle under a products name. I can add a product code and i could go with that option but i allso want to be able to use and see product code in the backend. I want the product subname to be different formating.

Best would be if i could add "Display product subname" etc Maybe tie with "description" field that is grayd out? EDIT: I have progressed a little pit.

I was able to add a subname to product with hikashop_product_custom_info_main.
I swapped the location to be right after the product name I moved this bit of the code: Now.. if i could just add this code to listing_img_title.php
But if i add the code it will not display the "subtitle" /custom info. Please help with this part and im good :)

Last edit: 10 years 5 months ago by jackinthex.

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

10 years 5 months ago #242302 by nicolas
The following user(s) said Thank You: jackinthex

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

10 years 5 months ago - 10 years 5 months ago #242340 by jackinthex
This solved it for listinng_img_title.php
But i can not get it to work with cart.php for some reason :(
Ideas?
Last edit: 10 years 5 months ago by jackinthex.

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

10 years 5 months ago #242378 by nicolas
I don't know.
There are several cart.php files in HikaShop. Which one are you talking about ?

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

10 years 5 months ago - 10 years 5 months ago #242488 by jackinthex
com_hikashop\views\checkout\tmpl\cart.php

It allso does not display on
com_hikashop\views\order\tmpl\form.php
Last edit: 10 years 5 months ago by jackinthex.

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

10 years 5 months ago #242516 by Xavier
Hi,

To add the value of a custom field in these views, you can simple use code like:
Code:
<?php echo $row->CUSTOMFIELD_NAME; ?>
The following user(s) said Thank You: jackinthex

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

10 years 5 months ago - 10 years 5 months ago #242626 by jackinthex
One small step at a time.
It solved the problem for: com_hikashop\views\checkout\tmpl\cart.php

It still does not work for backend : com_hikashop\views\order\tmpl\form.php
And invoice and billing invoice files.
Backend form is set to Yes



Im feeling more and more stupid. Sorry for being such a pain :blush:
Last edit: 10 years 5 months ago by jackinthex.

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

10 years 5 months ago - 10 years 5 months ago #242656 by Philip
Hello,

You don't edit the right file, here the good path to reach backend form.php :
administrator\components\com_hikashop\views\order\tmpl

Same idea for reach your invoice file :
administrator\components\com_hikashop\views\order\tmpl

"administrator\components\com_hikashop\views" folder able you to find back end view.

Hope this will help you.

Regards
Last edit: 10 years 5 months ago by Philip.

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

10 years 5 months ago - 10 years 5 months ago #242735 by jackinthex
I was edditing the correct files :(
It allso does not show subname field on show.php in orders.
I am totaly lost in this.

\www\my-site\components\com_hikashop\views\order\tmpl



Last edit: 10 years 5 months ago by jackinthex.

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

10 years 5 months ago #242739 by nicolas
Hi,

For the order/show.php view file, you need to first load the product data to be able to display the custom product field value.
Something like that:
<?php $class = hikashop_get('class.product');
$productData = $class->get($product->product_id);
echo $productData->CUSTOM_FIELD; ?>
The following user(s) said Thank You: jackinthex

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

10 years 5 months ago - 10 years 5 months ago #242755 by jackinthex
THANK YOU!!! You are a saint B)

For future referance for anyone looking for same solutions.


Added code is highlighted
red = added code, green= moved/edited:
form.php (backend)


invoice.php (backend)


show.php (front end - logged in)
Last edit: 10 years 5 months ago by jackinthex.

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

Time to create page: 0.115 seconds
Powered by Kunena Forum