Zen Cart Logo
Forums / Templates, Stylesheets, Page Layout / an override attempt didn't work

an override attempt didn't work

Locked

Views: 4,354

Results 1 to 16 of 16
This thread is locked. New replies are disabled.
11 Apr 2010, 7:10 PM
#1
mzimmers avatar

mzimmers

Zen Follower

Join Date:
May 2008
Posts:
453
Plugin Contributions:
0

an override attempt didn't work

Hi -

I tried overriding a file in includes/modules/payment with a similar file in includes/modules/CUSTOM/payment. The change didn't "take."

There's a twist here: the file is paypalwpp.php. Now, I don't have PayPal Website Payments Pro enabled in my orders total, but modifying this file does make some changes (it seems to define the text next to the PayPal logo during checkout).

So, are my overrides being ignored because this module is disabled? And somehow, it's picking up the text formatting anyway?

Thanks.

11 Apr 2010, 8:05 PM
#2
schoolboy avatar

schoolboy

Totally Zenned

Join Date:
Jun 2005
Location:
Cumbria, UK
Posts:
10,327
Plugin Contributions:
0

Re: an override attempt didn't work

While you create over-rides for the LANGUAGE files for payment modules (if you need to display labels associated with a payment module in another language, for example), the MODULE files do not go into an override folder, as these are for FUNCTION purposes and should not be "edited" or "modified" in any way.

Basically, you can see where "over-rides" are warranted on the basis of their being a "classic" folder at the over-ride level. Wherever you see a "classic" folder, you can create a folder at the same level named after your "custom" template. If a "classic" folder does not exist, then the rule is that an over-ride is not warranted for the files in question.

11 Apr 2010, 8:11 PM
#4
mzimmers avatar

mzimmers

Zen Follower

Join Date:
May 2008
Posts:
453
Plugin Contributions:
0

Re: an override attempt didn't work

schoolboy:

Basically, you can see where "over-rides" are warranted on the basis of their being a "classic" folder at the over-ride level. Wherever you see a "classic" folder, you can create a folder at the same level named after your "custom" template. If a "classic" folder does not exist, then the rule is that an over-ride is not warranted for the files in question.
Well, there is a modules/classic folder, so I assumed I could create a CUSTOM folder at this level.

And, it wasn't the actual text I wanted to change; it was some inline styling. Based on what you're saying, I guess I have no choice but to edit the file in the modules/payment directory.

11 Apr 2010, 8:14 PM
#5
schoolboy avatar

schoolboy

Totally Zenned

Join Date:
Jun 2005
Location:
Cumbria, UK
Posts:
10,327
Plugin Contributions:
0

Re: an override attempt didn't work

... but there ISN'T a classic folder inside modules/payment ... (so overrides are UNWARRANTED at this level...)

11 Apr 2010, 8:18 PM
#6
schoolboy avatar

schoolboy

Totally Zenned

Join Date:
Jun 2005
Location:
Cumbria, UK
Posts:
10,327
Plugin Contributions:
0

Re: an override attempt didn't work

mzimmers:

And, it wasn't the actual text I wanted to change; it was some inline styling. Based on what you're saying, I guess I have no choice but to edit the file in the modules/payment directory.

There is nothing to style in the modules files for payment modules... This is all FUNCTION code... there are no divs or embedded html.

Mike... leave these files alone... you will break your payment systems if you play with payment module files.

11 Apr 2010, 8:20 PM
#7
schoolboy avatar

schoolboy

Totally Zenned

Join Date:
Jun 2005
Location:
Cumbria, UK
Posts:
10,327
Plugin Contributions:
0

Re: an override attempt didn't work

What are you trying to "style"... ?

Styling at checkout payment stage is done via: tpl_checkout_payment_default.php

11 Apr 2010, 8:20 PM
#8
mzimmers avatar

mzimmers

Zen Follower

Join Date:
May 2008
Posts:
453
Plugin Contributions:
0

Re: an override attempt didn't work

schoolboy:

... but there ISN'T a classic folder inside modules/payment ... (so overrides are UNWARRANTED at this level...)

Ahhh...so the presence of the classic folder only works for that directory, not for directories under it. That's the Rosetta Stone (or at least part of it). Thanks for the clarification.

It still appears that I have to edit that file to un-do the inline styling, though. I won't tell if you don't.

11 Apr 2010, 8:22 PM
#9
schoolboy avatar

schoolboy

Totally Zenned

Join Date:
Jun 2005
Location:
Cumbria, UK
Posts:
10,327
Plugin Contributions:
0

Re: an override attempt didn't work

mzimmers:

It still appears that I have to edit that file to un-do the inline styling, though. I won't tell if you don't.

Well, I don't know what part of that file you intend to edit as there is nothing in it that controls style...

11 Apr 2010, 8:24 PM
#10
mzimmers avatar

mzimmers

Zen Follower

Join Date:
May 2008
Posts:
453
Plugin Contributions:
0

Re: an override attempt didn't work

From includes/modules/payment/paypallwpp.php, line 309:

    if ($this->enableDirectPayment == false) {
      return array('id' => $this->code,
                   'module' => '<img src="' . MODULE_PAYMENT_PAYPALWPP_MARK_BUTTON_IMG . '" alt="' . MODULE_PAYMENT_PAYPALWPP_MARK_BUTTON_TXT . '" /><span style="font-size:11px; font-family: Arial, Verdana;"> ' . MODULE_PAYMENT_PAYPALWPP_MARK_BUTTON_TXT . '</span>');
    }

Note the "style" statement in the span.

11 Apr 2010, 8:27 PM
#11
schoolboy avatar

schoolboy

Totally Zenned

Join Date:
Jun 2005
Location:
Cumbria, UK
Posts:
10,327
Plugin Contributions:
0

Re: an override attempt didn't work

Very observant! In nearly 3000 lines of code this is indeed a "style" - even though it's the only one!

11 Apr 2010, 8:31 PM
#12
schoolboy avatar

schoolboy

Totally Zenned

Join Date:
Jun 2005
Location:
Cumbria, UK
Posts:
10,327
Plugin Contributions:
0

Re: an override attempt didn't work

This is what I would do to it, however:

ORIGINAL:
<span style="font-size:11px; font-family: Arial, Verdana;">

MY SUGGESTION:
<span style="paypalwppFont">

Then, in stylesheet.css
**
.paypalwppFont {
font-size: 12pt;
color: #000;
}** or whatever...

11 Apr 2010, 8:34 PM
#13
mzimmers avatar

mzimmers

Zen Follower

Join Date:
May 2008
Posts:
453
Plugin Contributions:
0

Re: an override attempt didn't work

In truth, all I want to do is disable the inline styling, and let the defaults take over. To my (layman's) view, it seems that the best thing is just to eliminate it, no?

11 Apr 2010, 8:42 PM
#14
schoolboy avatar

schoolboy

Totally Zenned

Join Date:
Jun 2005
Location:
Cumbria, UK
Posts:
10,327
Plugin Contributions:
0

Re: an override attempt didn't work

If you follow my suggestion above, then you leave yourself the OPTION to do either...

By giving it its own unique style (and I made an ERROR in the earlier post - see below), you can choose whether to apply a declaration to the style class or not. If you don't then all parent styles will apply.

CORRECTION:

<span class="paypalwppFont">

11 Apr 2010, 8:48 PM
#15
mzimmers avatar

mzimmers

Zen Follower

Join Date:
May 2008
Posts:
453
Plugin Contributions:
0

Re: an override attempt didn't work

Sounds good to me. Thanks again.

4 Sep 2010, 3:18 PM
#16
s_mack avatar

s_mack

Totally Zenned

Join Date:
Jun 2005
Location:
Kelowna, BC Canada
Posts:
1,033
Plugin Contributions:
4

Re: an override attempt didn't work

This file is not coded well as it does have template information in the module file. I'm not sure if this is a requirement for PayPal compliance, or?? I'm going to open a "code suggestion" for it but I have a feeling they did it for a reason.

  • steven