Ina Code Blog

bunch of code in one place
Dec
17

Magento: Image zoom: set initial zoom

Posted by admin in Magento

The main product image needed to be zoomed in a little when page loads.

Open file: /js/varien/product.js and find at arounf line 89:

sliderValue:0,

and replace the value with the needed zoom value:

sliderValue:0.2,

Then find at around line 94:

this.scale(0);

and replace the value with the same zoom value:

this.scale(0.2);

[Slashdot] [Digg] [Reddit] [del.icio.us] [Facebook] [Technorati] [Google] [StumbleUpon]

Dec
17

Magento: Display default Add to cart quantity

Posted by admin in Magento

On product page the add to cart quantity field is empty, but I would like to display quantity value 1 or minimal add to quantity value.

Open file: /app/design/frontend/darila/darila/template/catalog/product/view/addtocart.phtml and find line

<input name=”qty” class=”input-text qty” id=”qty” maxlength=”12″ value=”<?php echo $this->getMinimalQty($_product) ?>” type=”text” />

and replace it with:

<input name=”qty” class=”input-text qty” id=”qty” maxlength=”12″ value=”<?php if($_product->isSaleable()): ?><?php echo $this->getMinimalQty($_product)== null?1:$this->getMinimalQty($_product) ?><?php else: ?><?php echo $this->getMinimalQty($_product)== null?0:$this->getMinimalQty($_product) ?><?php endif; ?>” type=”text” />

[Slashdot] [Digg] [Reddit] [del.icio.us] [Facebook] [Technorati] [Google] [StumbleUpon]

Dec
16

Magento: onepage checkout problem

Posted by admin in Magento

In the checkout process only step 1 and step 2 are active. I can not access step3: Shipping methods. I didn’t use standard magento classes in my page layout, I used #right instead .col-right and this is what solved my checkout problem:

Open file: /skin/frontend/darila/darila/js/opcheckout.js and find at around line 50:

var updater = new Ajax.Updater($$(’.col-right’)[0], this.progressUrl, {method: ‘get’, onFailure: this.ajaxFailure.bind(this)});

and replace .col-right with whatever class you used (in my case I used #right)

var updater = new Ajax.Updater($$(’#right’)[0], this.progressUrl, {method: ‘get’, onFailure: this.ajaxFailure.bind(this)});

Checkout process works great now.

[Slashdot] [Digg] [Reddit] [del.icio.us] [Facebook] [Technorati] [Google] [StumbleUpon]