Email template and pdf invoice

  • Posts: 73
  • Thank you received: 2
8 years 11 months ago #223526

-- HikaShop version -- : 2.6.0
-- Joomla version -- : 3.4.5
-- PHP version -- : 5.3.29
-- Browser(s) name and version -- : Firefox 41.0.2
-- Error-message(debug-mod must be tuned on) -- : No message

Hello,
I need to implement following things:

1. I'd like to change appearance for email template (change colours, etc.). Which file I have to edit?

2. I have complecated products which consists of several devices (kit products). I need somehow to insert all devices my product consists of in case if this is kit products. For example, have a look at this product:
right.travelsat.com.au/browse-products/2...ellite-tv-kit-deluxe
At the very bottom of the product description there is a "Summary of Inclusions". I need this list printed on the invoice (both email and PDF) below the name of the kit (so the buyer can check it off when they receive the delivery).
I guess I can create a text specific field for the product in order to insert this summury and then I need to insert this field in invoice and pdf invoice. Could you please help me to find out how to insert text of specific fields in invoice/pdf invoice? Or do you know more easy way to do this?

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

  • Posts: 82908
  • Thank you received: 13378
  • MODERATOR
8 years 11 months ago #223570

Hi,

1. You can go in the menu System>Emails and edit your emails' HTML version there.

2. You'll need to create a custom field of the table "product" and of the type "textarea" via the menu Display>Custom fields.
Then, in your products, you'll be able to enter that text in that custom field.
Then, edit the file plugins/hikashop/attachinvoice/attachinvoice/invoice.php and add such code:
<?php echo $product->column_name; ?>
for example before that code:
</td>
<td class="price">
and make sure that you replace column_name by the actual column name of your custom field.

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

  • Posts: 73
  • Thank you received: 2
8 years 11 months ago #223599

1. Thank you.

2. I've tried to do this, but without result. See attached files.

Attachments:

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

  • Posts: 82908
  • Thank you received: 13378
  • MODERATOR
8 years 11 months ago #223630

Hi,

Try like that instead then:
<?php $productClass = hikashop_get('class.product');
$productData = $productClass->get( $product->product_id);
echo $productData->column_name; ?>

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

  • Posts: 73
  • Thank you received: 2
8 years 11 months ago #223815

This works, but anyway there is a problem with this code. I've created 2 test products. First product has additional pecific field, for the second product I left this field empty.
When I add first product to cart (with field), and then second product (without field) - all is ok, I see specific field value for first product in email.
But when I add second product to cart and then first one - I don't see this field for both products. See attached images.

Attachments:

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

  • Posts: 82908
  • Thank you received: 13378
  • MODERATOR
8 years 11 months ago #223892

Hi,

Try like that instead then:
<?php $productClass = hikashop_get('class.product');
$productData = $productClass->get( $item->product_id);
echo $productData->column_name; ?>

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

  • Posts: 73
  • Thank you received: 2
8 years 11 months ago #223902

But I've already tried, you can see screenshot with this inserted code. It doesn't work when product with specific field goes after product without specific field in the cart. See all my 3 screenshots in previous post.

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

  • Posts: 82908
  • Thank you received: 13378
  • MODERATOR
8 years 11 months ago #223945

Hi,

The code I gave you in my last message is not the same as the one from the message before, and looking at your screenshot, I can confirm that you didn't try yet that new code. Please do so and you'll see that it should now display fine.

The following user(s) said Thank You: mypetfly

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

  • Posts: 73
  • Thank you received: 2
8 years 11 months ago #224009

This works! Thank you!

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

  • Posts: 73
  • Thank you received: 2
8 years 11 months ago #224166

Thank you very much! Actually your last variant doesn't work for pdf invoice, but your first variant works good in pdf invoice. So, I use combination of this 2 pieces of code for different cases. Also I need to add custom field at order details at user account page. Which view I need edit? Will this code work for this page (see attached screenshot)?

Also I need 1 more thing to be edited - I need to change name of order status prom "created" to "awaiting payment". So when user creates order - order must have status "awaiting payment" instead of "created". How I can do this? I need this to be modified everywhere (emails, orders page in user account, etc.)

Attachments:

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

  • Posts: 82908
  • Thank you received: 13378
  • MODERATOR
8 years 11 months ago #224177

Hi,

1. It's the file "show" of the view "order". The code from www.hikashop.com/forum/checkout/880984-e...-invoice.html#223630 should work there.

2. You can use a translation override:
hikashop.com/download/languages.html#modify

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

Time to create page: 0.078 seconds
Powered by Kunena Forum