Add a subname/Subtitle after product_name[SOLVED!]

  • Posts: 26
  • Thank you received: 1
9 years 3 months ago #242299

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: 9 years 3 months ago by jackinthex.

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

  • Posts: 84313
  • Thank you received: 13702
  • MODERATOR
9 years 3 months ago #242302
The following user(s) said Thank You: jackinthex

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

  • Posts: 26
  • Thank you received: 1
9 years 3 months ago #242340

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: 9 years 3 months ago by jackinthex.

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

  • Posts: 84313
  • Thank you received: 13702
  • MODERATOR
9 years 3 months ago #242378

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.

  • Posts: 26
  • Thank you received: 1
9 years 3 months ago #242488

com_hikashop\views\checkout\tmpl\cart.php

It allso does not display on
com_hikashop\views\order\tmpl\form.php

Last edit: 9 years 3 months ago by jackinthex.

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

  • Posts: 13201
  • Thank you received: 2322
9 years 3 months ago #242516

Hi,

To add the value of a custom field in these views, you can simple use code like:

<?php echo $row->CUSTOMFIELD_NAME; ?>

The following user(s) said Thank You: jackinthex

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

  • Posts: 26
  • Thank you received: 1
9 years 3 months ago #242626

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: 9 years 3 months ago by jackinthex.

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

  • Posts: 4820
  • Thank you received: 654
  • MODERATOR
9 years 3 months ago #242656

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: 9 years 3 months ago by Philip.

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

  • Posts: 26
  • Thank you received: 1
9 years 3 months ago #242735

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: 9 years 3 months ago by jackinthex.

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

  • Posts: 84313
  • Thank you received: 13702
  • MODERATOR
9 years 3 months ago #242739

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.

  • Posts: 26
  • Thank you received: 1
9 years 3 months ago #242755

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: 9 years 3 months ago by jackinthex.

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

Time to create page: 0.087 seconds
Powered by Kunena Forum