Custom Product Field in the Invoice

  • Posts: 103
  • Thank you received: 0
12 years 2 days ago #77908

Hi Guys,

In the orders there is an "Additional Information" bit I can see one of my custom fields for the order.. but I can't see how to put on a custom field that I've attached to each product.

Thoughts? Hmm I bet it's in one of the Display Views.

Thanks!

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

  • Posts: 13201
  • Thank you received: 2322
12 years 2 days ago #77924

Hi,

To add the product custom field in the order, you will have to edit the view "order / show".
And display the values wanted in the foreach.

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

  • Posts: 103
  • Thank you received: 0
12 years 22 hours ago #78373

Hi Xavier,

I have added the following lines in both order/show and order/invoice

<span class="hikashop_product_code_order"><?php echo $product->order_product_code; ?></span>
/* NEW LINES ADDED BELOW */
                          <?php $class=hikashop_get('class.product');
                          $prod = $class->get($product->product_id);
                          echo $prod->fundstocharity;
                          ?>
where "fundstocharity" is my column name in my table product. (text field) also I have enabled backend listing but I still can't see it when I click on existing orders or when I click on the invoice button.. and I even created a new order worrying that maybe it dodn't fix it to existing ones. Thoughts? My PHP skills are less-than-standard.

THANKS!

Last edit: 12 years 20 hours ago by Jerome.

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

  • Posts: 26158
  • Thank you received: 4028
  • MODERATOR
12 years 20 hours ago #78392

Hi,

You code looks good.
Are you sure that you have edit the view for the right backend template ?
You can check it by writing

echo 'Funds to charity: ' . $prod->fundstocharity;

Regards,


Jerome - Obsidev.com
HikaMarket & HikaSerial developer / HikaShop core dev team.

Also helping the HikaShop support team when having some time or couldn't sleep.
By the way, do not send me private message, use the "contact us" form instead.

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

  • Posts: 103
  • Thank you received: 0
12 years 13 hours ago #78473

Hi Jerome,

Tried that.. can't see it printed anywhere.. double checked I have the correct column name.. took the column bit out and just tried to echo 'Funds to Charity'; no luck

Here is a screen print of what views I customized with the code.. you can see I have it on my ju_joomla template trying it in both order/show and order/invoice.. (did different)..

Hmmmm

Attachments:

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

  • Posts: 26158
  • Thank you received: 4028
  • MODERATOR
12 years 12 hours ago #78477

Hi,

I don't know for your frontend template but your backend template is "bluestork".

Regards,


Jerome - Obsidev.com
HikaMarket & HikaSerial developer / HikaShop core dev team.

Also helping the HikaShop support team when having some time or couldn't sleep.
By the way, do not send me private message, use the "contact us" form instead.
The following user(s) said Thank You: SuzyBGood

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

  • Posts: 103
  • Thank you received: 0
12 years 12 hours ago #78479

THANK YOU! I started editing after I thought about your hint about the correct template.. I have never edited a display that was "back end" before. Didn't really think it had a different template.

All I can add to this is "DUH"

THANK YOU THANK YOU

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

  • Posts: 103
  • Thank you received: 0
11 years 11 months ago #78617

Ok, obviously I haven't learned my lesson...

I have it working.. I KNOW I am editing the right template. But I am trying to do the right thing and put the title in the LANGUAGE file.

Entry in language looks like this:

FUNDS="Donation"

and the echo entry in my code is:


echo JText::_('FUNDS') . $prod->fundstocharity;

but in my invoice it just reads FUNDS $3.00 etc.. it isn't using the language file to translate?

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

  • Posts: 26158
  • Thank you received: 4028
  • MODERATOR
11 years 11 months ago #78621

Hi,

Do your modify the language file or do you use the "override" section ?
The "override" part could not be loaded by Joomla sometimes, it is a limitation that we are trying to bypass.
Which Joomla version are you using ? It would help us for our tests.

Regards,


Jerome - Obsidev.com
HikaMarket & HikaSerial developer / HikaShop core dev team.

Also helping the HikaShop support team when having some time or couldn't sleep.
By the way, do not send me private message, use the "contact us" form instead.

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

  • Posts: 103
  • Thank you received: 0
11 years 11 months ago #78622

Hi,

I am using the Override section. I have had success with this in other areas on other templates. I can put the words in for now.. just was wondering what I was missing. I am using the last latest version (prior to the upgrade a couple of weeks ago, 2.5 sounds right but that could be Joomla) Business Edition. I just got it all working so I am afraid to upgrade!! ;)

Cheers

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

  • Posts: 26158
  • Thank you received: 4028
  • MODERATOR
11 years 11 months ago #78624

Hi,

Please try to add your translation in the "language" part.
As I said, the "override" part would not work everywhere, specially in emails (due a language context switch).

Regards,


Jerome - Obsidev.com
HikaMarket & HikaSerial developer / HikaShop core dev team.

Also helping the HikaShop support team when having some time or couldn't sleep.
By the way, do not send me private message, use the "contact us" form instead.
The following user(s) said Thank You: SuzyBGood

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

Time to create page: 0.080 seconds
Powered by Kunena Forum