if statement for if product text field does not equal a certain expression

August 25, 2010 Leave a comment
<?php if ($_product->getSku()!=='what it says in text field'):?>
<?php endif; ?>
Categories: Uncategorized

Magento eCommerce 1.3.2.4 :: Hover Rollover Mouse Effect on the Add-to-cat button and info buttons

January 20, 2010 Leave a comment

This was kinda easy, but I didnt know what to do for the longest time. I could not find any info on how to do this.

Here is what I did.

Just add this to your boxes.css file in your skin/frontend/default/[theme]/css folder

/*The background color is the effect I had for mine when I rolled my mouse over the button*/

.form-button:hover, .form-button-alt:hover { background:#cc9900; }

If you want a different background color, change the background: to what ever you want, if you want to add border or whatever, this is where it is done.
Just add that to your css page, if you dont know which one to add it to, then add it to skin/frontend/default/[your theme]/css/boxes.css
–Hope this helps someone else too
Magento 1.3.2.4
Categories: Uncategorized

Magento eCommerce 1.3.2.4:: Or statement based on variable input on attribute.phtml page – using static block as includes

January 11, 2010 1 comment
I used this statement below to get either static block for a variable input on the attributes.phtml page
<?php if ($_product->getData(‘upac_features’)): ?>
<?php $_upac_features= $_product->getResource()->getAttribute(‘upac_features’)->getFrontend()->getValue($_product); ?>
<?php if (($_upac_features==’ipod_sat_hd’) or ($_upac_features==’ipod_hd’)){
echo $this->getLayout()->createBlock(‘cms/block’)->setBlockId(‘upac-ipod-no-sirius’)->toHtml()
; }
else {
echo $this->getLayout()->createBlock(‘cms/block’)->setBlockId(‘upac-ipod-sirius’)->toHtml()
; } ?>
<?php endif; ?>
Categories: Uncategorized

Magento eCommerce:: Change the size of the Price (font-size) on various pages like catalog, related, view.phtml

January 7, 2010 1 comment

Like I said before I am really a novice at web dev. But I could not find this info anywhere, so here it is. It took me a a little while to figure this out.

Too change the price size on the catalog page:

/* Catalog pricing */
.product-info-box .price { font-weight:bold; font-size:20px; }

Too change the price size, and make text color black on the related products block (on the category page):

/* Related products */
.product-details .price { font-weight:bold; font-size:14px; color:#000000; }

If you want a different font size, change the font-size: to what ever you want, if you want to add color or whever, this is where it is done.
Just add that to your css page, if you dont know which one to add it to, then add it to skin/frontend/default/[your theme]/css/boxes.css
–Hope this helps someone else too
Magento 1.3.2.4
Categories: Uncategorized

Magento 1.3.2.4 :: or statement based on variable input on available.phtml ->getMethodTitle

January 5, 2010 Leave a comment

I used this staement below on the available.phtml page to add some text if the shipping method was either UPS next day air or UPS 2nd day air

<?php if(($_rate->getMethodTitle()==’UPS Second Day Air’) or ($_rate->getMethodTitle()==’UPS Next Day Air’)):?>or statement<?php endif ;?>

–Bryan Sammon

Categories: Uncategorized

Magento 1.3.2.4 — Add a shipping map to your checkout page (one page checkout)

January 5, 2010 1 comment

I wanted to add a UPS shipping map to my checkout page in magento 1.3.2.4.

The file that needs to be edited is: app/frontend/design/default (or other theme) /[Choose your template]/checkout/onepage/shipping_method/available.phtml

This statement below will add whatever html you want to add to the UPS ground line on the checkout page.

<?php if($_rate->getMethodTitle()==’UPS Ground’):?><span>INSERT YOUR HTML HERE</span><?php endif ;?>

I wanted this to go on the same line as the UPS Ground and price.

Here is what my code ending up looking like:

From line 35:

<?php foreach ($_rates as $_rate): ?>

<li>
<?php if ($_rate->getErrorMessage()): ?>
<ul><li><ul><li><?php echo $_rate->getErrorMessage() ?></li></ul></li></ul>
<?php else: ?>
<input name=”shipping_method” type=”radio” value=”<?php echo $_rate->getCode() ?>” id=”s_method_<?php echo $_rate->getCode() ?>”<?php if($_rate->getCode()===$this->getAddressShippingMethod()) echo ‘ checked=”checked”‘ ?> />
<label for=”s_method_<?php echo $_rate->getCode() ?>”><?php echo $_rate->getMethodTitle() ?>
<strong>
<?php $_excl = $this->getShippingPrice($_rate->getPrice(), $this->helper(‘tax’)->displayShippingPriceIncludingTax()); ?>
<?php $_incl = $this->getShippingPrice($_rate->getPrice(), true); ?>
<?php echo $_excl; ?>
<?php if ($this->helper(‘tax’)->displayShippingBothPrices() && $_incl != $_excl): ?>
(<?php echo $this->__(‘Incl. Tax’); ?> <?php echo $_incl; ?>)
<?php endif; ?>
</strong>
</label><?php if($_rate->getMethodTitle()==’UPS Ground’):?><span>DOES this work</span><?php endif ;?>
<?php endif ?>
</li>
<?php endforeach; ?>

I used UPS ground, for my example. But you can put in any method you want from your checkout page. For example, Priority Mail or USPS Next Day Air work too etc..
You will need one of these statements for each method you want to put text by. Add style or class to your span tag to add a custom design to it.
You may need to change out the ” quotes for ones that actually work in html, depending on how this copies.
Hope this helps.
–Bryan
Categories: Uncategorized

If and else statement on Attributes.phtml

January 3, 2010 Leave a comment
<?php if ($_product->getData(‘title_info’)): ?>
<?php $_title_info= $_product->getResource()->getAttribute(‘title_info’)->getFrontend()->getValue($_product); ?>
<?php if ($_title_info==”upac-videos”): ?>
<p>Videos shown below also may also show operation with the optional <a href=”/pac-hdrt-hd-radio-tuner.html” title=”optional HDRT HD Radio Tuner”>HD Radio</a> or <a href=”/scc1-sirius-connect-tuner.html” title=”optional SCC1 Sirius Connect Radio Tuner”>Sirius Radio Tuner</a>. If you do not want the HD/Sirius Tuner, you can use the included aux input instead.</p>
<?php else:?>
<?php echo $_product->getVideoTitleText() ?>
<?php endif;?>
<?php endif; ?>
Categories: Uncategorized

Attribute include based on custom Design – useful tip on attribute.phtml

January 2, 2010 Leave a comment

This will do a include based on the custom design.

<?php if ($_product->getData('custom_design')): ?>
<?php $_custom_design= $_product->getResource()->getAttribute('custom_design')->getFrontend()->getValue($_product); ?>
<?php if ($_custom_design=="default/your theme name"){
echo $this->getLayout()->createBlock('cms/block')->setBlockId('static block id1')->toHtml()
; }
else {
echo $this->getLayout()->createBlock('cms/block')->setBlockId('static block id2')->toHtml()
; } ?>
<?php endif; ?>

Categories: Uncategorized

Magento eCommerce:: Best advice I could ever give anyone with alot of products

December 30, 2009 Leave a comment

Edit the attributes.phtml file. Set the description separate from the (foreach) statement. This will help a ton.

Categories: Uncategorized

Magento eCommerce::If and else statement when using static block includes

December 30, 2009 Leave a comment

I did this on the attributes.phtml file:

<?php if ($_product->CompatibleIpods2 ==1){
echo $this->getLayout()->createBlock(‘cms/block’)->setBlockId(‘upac-compatible-ipods-3g’)->toHtml()
; }
else {
echo $this->getLayout()->createBlock(‘cms/block’)->setBlockId(‘upac-compatible-ipods-without-3g’)->toHtml()
; } ?>

Worked nicely. This way I can use one statement if the attribute: CompatibleIpods2 (type: yes/no) was set to yes (1) or no (2)

Magento 1.3.2.4

Categories: Uncategorized
Follow

Get every new post delivered to your Inbox.