A place to log my programming solutions.

Category :: Programming

17
Feb 10

IE6 Phantom Text / Duplicate Text Bug

Just for purposes of documenting this useful knowledge:

When viewing in Internet Explorer 6 and experiencing the “strange-repeated-text” problem, try applying this CSS to the element containing the text that gets repeated:

float: none;
clear: both;

Knowledge from: http://uxdev.blogspot.com/2008/10/phantom-text-in-ie6.html

3
Dec 09

Force IE8 to Render Like IE7

Found this little snippet yesterday. I’m not saying that this is best practice in any way, but if you’re looking for a quick fix, here it is:

<meta content='IE=EmulateIE7' http-equiv='X-UA-Compatible'/>

I think this has the effect of enabling “Compatibility Mode” that the user would normally have to turn on.

As a side note, the specific reason I used this was to make a Google Friend Connect widget render properly — there are plenty of posts on the web about those widgets not working in IE8.

26
Oct 09

Magento $this->getSkinUrl() Wrong Template

When using $this->getSkinUrl(‘path/to/yourfile.html’) inside view (.phtml) code, and you’re getting /default/default/ instead of /default/yourtheme, this isn’t Magento working incorrectly.  Check the $argument you send and verify that the target file actually exists.

getSkinUrl() does more than just generate the proper URL, it also verifies that the file exists.  If it doesn’t find the file within the store’s /yourtheme folder, it will revert to /default.

12
Oct 09

Script Double Run / Double Execute Phenomenon

I had a problem with your PHP code running or executing seemingly twice.  To debug this phenomenon, I put some write-to-file code at the beginning of the script.  Surprisingly, whenever I loaded my script in the browser, the file would be written to twice despite my one page load.

The problem was that The page I was developing had an <img> in it with the “src” attribute set blank.  When the document was fully loaded, javascript was in place to dynamically assign the “src”.  This worked perfectly fine in the pre-server-side-logic stage of development so it was an easy decision to begin debugging server-side logic.

The double execute happens when Firefox sees <img src=”" />.  Not knowing what source to assign, it sends a request (the second request) to the current path (again) for the image.  Therein lies the problem.  It’s interesting to note that Firefox is not to blame, as it’s following HTML specification.

12
Oct 09

Introducing Magento Widgets

Magento Widgets allow business users with no technical knowledge to easily add dynamic content (including product data, for example) to pages in Magento Stores.  This allows for greater control and flexibility in creating informational and marketing content through administrator tools, enabling intuitive and efficient control of content Read more »

8
Sep 09

Magento Clear Shopping Cart and Session

If you ever need to programmatically clear Magento’s shopping cart, use the snippet of code below. If you need to clear the user’s entire session, including the shopping cart, shipping information, billing information and chosen payment methods, please refer to the snippet further below.

Read more »

20
Aug 09

Clear Magento Customers, Orders, Searches, and Tags

From the Magento dashboard, there is no intuitive way of deleting/clearing/resetting customer, order, search, or tag data. As developers, we have to test the various functions of our specific Magento setup before presenting it to the client. Before the site can go live, all of the test data has to be removed so it doesn’t interfere with the client’s other business functions such as accounting and inventory.

Read more »

18
Aug 09

Magento Configurable Product Pricing

Let’s say for example that configurable product A is defined to have 2 attributes “color” and “size”.  Values for color may be: Black, White, Chrome while values for size may be: 1″, 2″, 3″, and 4″.

One would expect that there should be a price matrix that might look like:

1″ 2″ 3″ 4″
Black $1.00 $1.20 $1.40 $1.60
White $1.05 $1.25 $1.45 $1.65
Chrome $1.15 $1.35 $1.55 $1.75

Read more »

About NVNCBL and Myself

Contact Me