Post by kevinbarnes » Sun Nov 26, 2017 10:03 pm

Hi, I am trying to add an condition in order.tpl file which will check specific product code and based on that it will select customized greeting message and sending this in to order confirmation mail to the customer. I executed the below changes via VQMOD but still it is catching old default greeting if condition matches with new language greeting. Do you see any issues with this. Thank you in advance

<file name="catalog/language/english/mail/order.php">
<operation>
<search position="replace">
<![CDATA[$_['text_new_greeting'] = 'Thank you for Shopping with %s. <br><br> You have completed your payment successfully <br><br> Your Order will be shipped within 4 - 6 Business days <br><br> As soon as your order is fulfilled and shipped, we will send you an email notification with tracking details <br><br> <b>Happy 3D Printing!!! </b><br>';]]>
</search>
<add>
<![CDATA[

$_['text_new_greeting'] = '<b>Dear %s %s,</b><br /><br />Thank you for Shopping with %s. <br><br> You have completed your payment successfully <br><br> Your Order will be shipped within 4 - 6 Business days <br><br> As soon as your order is fulfilled and shipped, we will send you an email notification with tracking details <br><br> <b>Happy 3D Printing!!! </b><br>';
$_['text_new_one'] = '<b>Dear %s %s,</b><br /><br />Thank you for Shopping with %s. <br><br> You have completed your payment successfully <br><br> Your Order will be shipped within 10 - 15 Business days <br><br> As soon as your order is fulfilled and shipped, we will send you an email notification with tracking details <br><br> <b>Happy 3D Printing!!! </b><br>';
$_['text_new_two'] = '<b>Dear %s %s,</b><br /><br />Thank you for Shopping with %s. <br><br> You have completed your payment successfully <br><br> Your Order will be shipped within 6 - 10 Business days <br><br> As soon as your order is fulfilled and shipped, we will send you an email notification with tracking details <br><br> <b>Happy 3D Printing!!! </b><br>';

]]>


</add>
</operation>
</file>
<file name="catalog/model/checkout/order.php">
<operation>
<search position="replace">
<![CDATA[$data['text_greeting'] = sprintf($language->get('text_new_greeting'), $order_info['store_name']);]]>
</search>
<add>

<![CDATA[

$data['text_greeting'] = sprintf($language->get('text_new_tevo'), $order_info['payment_firstname'],$order_info['payment_lastname'],$order_info['store_name']);
$data['text_one'] = sprintf($language->get('text_new_one'), $order_info['payment_firstname'],$order_info['payment_lastname'],$order_info['store_name']);
$data['text_two'] = sprintf($language->get('text_new_two'), $order_info['payment_firstname'],$order_info['payment_lastname'],$order_info['store_name']);
]]>
</add>
</operation>
</file>


order.tpl
I was implementing direct changes in order.tpl in my local, yet to apply vqmod but still below the code used by me.

Replacing this
<p style="margin-top: 0px; margin-bottom: 20px;"><?php echo $text_greeting; ?></p>


to

<?php if($product['model']=="BAY-0165") ?>
<?php { ?>
<p style="margin-top: 0px; margin-bottom: 20px;">
<?php echo $text_one; ?>
</p>
<?php }?>

<?php elseif($option['name']=="Extended Z ") ?>
<?php { ?>
<p style="margin-top: 0px; margin-bottom: 20px;">
<?php echo $text_two; ?>
</p>

<?php }?>
<?php else?>
<?php { ?>
<p style="margin-top: 0px; margin-bottom: 20px;">
<?php echo $text_greeting; ?>
</p>
<?php }?>

New member

Posts

Joined
Sat Jul 09, 2016 2:22 pm

Post by straightlight » Sun Nov 26, 2017 10:20 pm

Do you see any issues with this.
One issue, so far. The OC version is not posted.

Dedication and passion goes to those who are able to push and merge a project.

Regards,
Straightlight
Programmer / Opencart Tester


Legendary Member

Posts

Joined
Mon Nov 14, 2011 11:38 pm
Location - Canada, ON

Post by kevinbarnes » Sun Nov 26, 2017 11:12 pm

Sorry about that, It is OC 2.0.3.1

New member

Posts

Joined
Sat Jul 09, 2016 2:22 pm

Post by straightlight » Sun Nov 26, 2017 11:26 pm

A solution can be provided, yes. However, by editing core files at the same time you edit an XML file, it may not guarantee its success. Is there a purpose / goal on why these files needs to be edited separately rather than editing entirely from XML?

Dedication and passion goes to those who are able to push and merge a project.

Regards,
Straightlight
Programmer / Opencart Tester


Legendary Member

Posts

Joined
Mon Nov 14, 2011 11:38 pm
Location - Canada, ON

Post by kevinbarnes » Sun Nov 26, 2017 11:36 pm

I was testing why the simple if else was not working. I am not insisting to change in core. Even this .tpl changes can be added to XML without touching core. So you are saying, if i add this changes in XML , will make work? I don't see the logic

New member

Posts

Joined
Sat Jul 09, 2016 2:22 pm

Post by straightlight » Sun Nov 26, 2017 11:44 pm

In this case, can you post the attached XML file?

Dedication and passion goes to those who are able to push and merge a project.

Regards,
Straightlight
Programmer / Opencart Tester


Legendary Member

Posts

Joined
Mon Nov 14, 2011 11:38 pm
Location - Canada, ON

Post by kevinbarnes » Sun Nov 26, 2017 11:55 pm

<file name="catalog/view/theme/default/template/mail/order.tpl">
<operation>
<search position="replace">
<![CDATA[ <p style="margin-top: 0px; margin-bottom: 20px;"><?php echo $text_greeting; ?></p>]]>
</search>
<add>

<![CDATA[

<?php if($product['model']=="BAY-0165") ?>
<?php { ?>
<p style="margin-top: 0px; margin-bottom: 20px;">
<?php echo $text_one; ?>
</p>
<?php }?>

<?php elseif($option['name']=="Extended Z ") ?>
<?php { ?>
<p style="margin-top: 0px; margin-bottom: 20px;">
<?php echo $text_two; ?>
</p>

<?php }?>
<?php else?>
<?php { ?>
<p style="margin-top: 0px; margin-bottom: 20px;">
<?php echo $text_greeting; ?>
</p>
<?php }?>
]]>
</add>
</operation>
</file>

New member

Posts

Joined
Sat Jul 09, 2016 2:22 pm

Post by straightlight » Sun Nov 26, 2017 11:57 pm

Please post the complete file as an attachment in order to troubleshoot these codes.

Dedication and passion goes to those who are able to push and merge a project.

Regards,
Straightlight
Programmer / Opencart Tester


Legendary Member

Posts

Joined
Mon Nov 14, 2011 11:38 pm
Location - Canada, ON

Post by kevinbarnes » Mon Nov 27, 2017 12:08 am

Attached VQMOD XML

New member

Posts

Joined
Sat Jul 09, 2016 2:22 pm

Post by straightlight » Mon Nov 27, 2017 1:07 am

From the VQMod Manager or, if using OCMod, from the admin - > extensions page, do you see any recent entries in the logs?

Dedication and passion goes to those who are able to push and merge a project.

Regards,
Straightlight
Programmer / Opencart Tester


Legendary Member

Posts

Joined
Mon Nov 14, 2011 11:38 pm
Location - Canada, ON

Post by kevinbarnes » Mon Nov 27, 2017 1:14 am

No recent entries

New member

Posts

Joined
Sat Jul 09, 2016 2:22 pm

Post by straightlight » Mon Nov 27, 2017 1:23 am

Replace:

Code: Select all

$$
with:

Code: Select all

$
on line 8.

Dedication and passion goes to those who are able to push and merge a project.

Regards,
Straightlight
Programmer / Opencart Tester


Legendary Member

Posts

Joined
Mon Nov 14, 2011 11:38 pm
Location - Canada, ON

Post by kevinbarnes » Mon Nov 27, 2017 1:43 am

Sorry. It was corrected after that before i upload, but still no mail is sent

New member

Posts

Joined
Sat Jul 09, 2016 2:22 pm

Post by straightlight » Mon Nov 27, 2017 2:16 am

No mail is sent. Have you checked the access logs for mail activities from your webserver?

Dedication and passion goes to those who are able to push and merge a project.

Regards,
Straightlight
Programmer / Opencart Tester


Legendary Member

Posts

Joined
Mon Nov 14, 2011 11:38 pm
Location - Canada, ON

Post by kevinbarnes » Mon Nov 27, 2017 2:24 am

It seems you never used the attached xml to troubleshoot?

New member

Posts

Joined
Sat Jul 09, 2016 2:22 pm

Post by straightlight » Mon Nov 27, 2017 2:29 am

There were no indications on this topic where I would mention not to check the XML file. However, I did checked the XML file. Each search lines from the OC version that you have specified are indeed seeking for the right lines from the XML file. Although, it still does not answer my question above if you did checked the access logs from your webserver based on your email activities.

Dedication and passion goes to those who are able to push and merge a project.

Regards,
Straightlight
Programmer / Opencart Tester


Legendary Member

Posts

Joined
Mon Nov 14, 2011 11:38 pm
Location - Canada, ON

Post by kevinbarnes » Mon Nov 27, 2017 2:33 am

When i edit directly in order.tpl. Mail is sent and if i put that in XML mail is not sent. Also no errors or mail log from my webserver as well

New member

Posts

Joined
Sat Jul 09, 2016 2:22 pm

Post by straightlight » Mon Nov 27, 2017 2:35 am

You might also be using multiple XML files, which is fine. Although, I would suggest the use of the VQMod Manager in this case in order to ease the troubleshooting between XML files.

Dedication and passion goes to those who are able to push and merge a project.

Regards,
Straightlight
Programmer / Opencart Tester


Legendary Member

Posts

Joined
Mon Nov 14, 2011 11:38 pm
Location - Canada, ON
Who is online

Users browsing this forum: No registered users and 44 guests