Just clarify, did you add something to one of the defines like PAYMENT_METHOD_DETAIL or something, to put the image in ?
Just clarify, did you add something to one of the defines like PAYMENT_METHOD_DETAIL or something, to put the image in ?
That would help huh LOL
I added the code into includes/languages/english/modules/payment/worldpay.php
PHP Code:
define('MODULE_PAYMENT_WORLDPAY_TEXT_TITLE', '<img src="https://select.worldpay.com/jsp/shopper/pictures/poweredByWorldPay.gif" alt="WorldPay" /><br /> Credit Card via WorldPay');
HunnyBee Design
"A man's manners are a mirror in which he shows his portrait." ~ Johann Wolfgang von Goethe
I am buggered if I can find a cunning way of doing it, but the simple way if for you to edit
/email/email_template_wp_callback.html
there's all kinds of variables in there so after each one put (a) (b) (c) do a test order, look at the email to work out which variable was affected and then replace it. so if it is $PAYMENT_METHOD_DETAIL being replaced by your constant MODULE_PAYMENT_WORLDPAY_TEXT_TITLE then you just remove $PAYMENT_METHOD...
The automatic emailing sytem in includes/classes/orders.php which would involve a lot of editing of code, when the easy way is just to replace the section in the email template with whatever you want.
Philip.
I'm trying to understand that, but I'm a bit lost even contemplating it LOL
The code in includes/modules/payment/worldpay.php that calls the define MODULE_PAYMENT_WORLDPAY_TEXT_TITLE is this section here on Line 54:
I was wondering if I can add in an extra constant I create in the language file for the image, say MODULE_PAYMENT_WORLDPAY_IMG for example somewhere before MODULE_PAYMENT_WORLDPAY_TEXT_TITLE in that code? Is that possible?Code:$this->title = (IS_ADMIN_FLAG === true) ? MODULE_PAYMENT_WORLDPAY_TEXT_ADMIN_DESCRIPTION.' v'.$this->moduleVersion .( (MODULE_PAYMENT_WORLDPAY_TEST_MODE != 0) ? ' <b style="color:red">(Test Mode activated)</b>' : '') : MODULE_PAYMENT_WORLDPAY_TEXT_TITLE; $this->enabled = ((MODULE_PAYMENT_WORLDPAY_STATUS == 'True') ? true : false);
As you can see I am very very new to php and not overly sure what I am doing most of the time LOL
HunnyBee Design
"A man's manners are a mirror in which he shows his portrait." ~ Johann Wolfgang von Goethe
Ok you are not bad in that you hae the right constant and location but you don't get the big picture. An entirely diffferent part of zencart after an order is successfully makred as paid, starts working on the tables, it pulls the constant through from the worldpay module and embeds it in the "order", in a single static row in a table that is saved for all time (that's hwo it's supposed to work). Now when it does this, it happens to pull the email template, does a quick search and replace and sends out the html, from the same information.
So if you created a new constant then you would have two options, either a) start playing with the module to get it to send out the new constant only after the order was successful, or b) start playing with the core of zencart and telling it to ignore what it normally does and change the constant in the email.
The third way is what I suggested, edit the template for the emails that goes out. The template is a basic seearch & replace with information from the core of zencart, so you can write "I'm a blue monkey" in there and it will go out just as you wrote it. Things in Capitals with a $ in in front of them get replaced by zencart so you need to locate the $VARIABLE that shows your image, and just put "Paid by Worldpay" in it's place, so just mark up each section of the email template with letters or numbers so that when you put a test order through, you can work out which bit to change. I'd do this but I don't have a worldpay account (yes I know that I run the module and it's just weird, but it's also true) and I haven't got a spare demo site set up (which takes a couple of hours) when it's faster that you send yourself an email.
It's a worldpay only template so won't affect any other users or processes, so you find the file,
/email/email_template_wp_callback.html
mark it up with numbers so that you can locate which variable to replace, and remove the sentence "I'm a blue monkey" before going "live".
Philip.
Ok, I think I am getting closer to understanding this LOL and I believe the variable that needs changing is $PAYMENT_METHOD_DETAIL, what I don't know...or understand...is where this variable is 'defined' or written to change it, I tried looking it up in the developer's toolkit and it can't find it lol, so I think I am not understanding how or where to change that variable.
**edited in to add that I can find the variable without the $ in includes/classes/orders.php:
but I really don't wanna screw up the file by mucking around with what I don't know LOLCode:$html_msg['PAYMENT_METHOD_DETAIL'] = (is_object($GLOBALS[$_SESSION['payment']]) ? $GLOBALS[$payment_class]->title : PAYMENT_METHOD_GV );
BTW I read earlier in the thread how you'd applied for a test account with WP and I think they really should give you one considering how much work you've put into enabling their customers to increase their money for them lol
Last edited by LissaE; 6 Feb 2009 at 02:32 AM.
HunnyBee Design
"A man's manners are a mirror in which he shows his portrait." ~ Johann Wolfgang von Goethe
Mulling over this....lol
Would the correct way to change this be to in includes/classes/orders.php add the following in red below:
Then in includes/languages/english/wp_callback.php add the follwing define:Code:$html_msg['PAYMENT_METHOD_DETAIL'] = (is_object($GLOBALS[$_SESSION['payment']]) ? $GLOBALS[$payment_class]->title : PAYMENT_METHOD_GV ); $html_msg['PAYMENT_METHOD_DETAIL_WP'] = EMAIL_TEXT_PAYMENT_METHOD_DETAIL_WP;
And then finally in email/email_template_wp_callback.html replaceCode:define('EMAIL_TEXT_PAYMENT_METHOD_DETAIL_WP', 'Credit Card Via Worldpay');
withCode:$PAYMENT_METHOD_DETAIL
Am I on the right track? Or way out of my league? LOLCode:$PAYMENT_METHOD_DETAIL_WP
HunnyBee Design
"A man's manners are a mirror in which he shows his portrait." ~ Johann Wolfgang von Goethe
Oo I am making this harder on myself than it has to be aren't I? I have read and re-read your reply and you literally mean to replace $PAYMENT_METHOD_DETAIL in the email template with Credit Card Via Worldpay ?![]()
![]()
HunnyBee Design
"A man's manners are a mirror in which he shows his portrait." ~ Johann Wolfgang von Goethe
Spot on, just rip the variable out of the template and plonk in whatever you want. Keep it Simple not so stupid, as you've done very very well in searching around in the bowels of zen cart, It's probably and anglo-australian misunderstanding. Find the template, test it for the place you want your new thing and then replace the variable in the file, not elsewhere.
As for worldpay, who really knows and understands their logic, they have a clearly published set of developer guidelines, but no testing mechanism unless you pay for a merchant account, and I only inherited this module when I broke it. There's supposed to be an affiliate reommend system too, and I haven't got that either, the only reason I know is that every so often somone comes along here and spams the forum. I rely on people trusting me enough to give me access to their merchant accounts just to run this and with ZC 2.0 around the corner, everything will stop working.
Well, you know we are an upside down backward lot down here LOL add in blonde DNA to the mix and there's bound to be trouble
You ever need to test with a merchant account gimme a holler, I really don't make enough worth stealing at the moment ROFLMAO and I would trust you anyways ;)
HunnyBee Design
"A man's manners are a mirror in which he shows his portrait." ~ Johann Wolfgang von Goethe
Bookmarks