Practical Web Applications for Daily Living…
html/css
Ecommerce Consultants based in Singapore
Sep 6th
I am trying this keyword if I will be index if somebody search for Ecommerce Consultant base in Singapore, well.. actually yes, we are one of the best ecommerce consultants in Singapore, we design, develop and deploy your ecommerce system in ourr secure web servers. Need ERP? you’ve landed on the right page. Please drop me an email or visit Entrust Network Services Pte Ltd for more information.
Setting Up Contact Form within Static Block in Magento
Aug 31st
Just put this within your static block
<ul>
<li>
<div class="input-box">
<div><label for="name">Name <span class="required">*</span></label> <input id="name" class="required-entry input-text" title="Name" name="name" type="text" /></div>
<div class="input-box"><label for="email">Email <span class="required">*</span></label></div>
<div><input id="email" class="required-entry input-text validate-email" title="Email" name="email" type="text" /></div>
<div class="input-box"><label for="telephone">Telephone</label><br /> <input id="telephone" class="input-text" title="Telephone" name="telephone" type="text" /></div>
<div class="input-box"><label for="comment">Comment</label><br /> <textarea id="comment" class="input-text" style="height: 150px; width: 525px;" title="Comment" cols="50" rows="5" name="comment"></textarea></div>
</div>
</li>
</ul>
</fieldset>
<div class="button-set">
<p class="required">* Required</p>
<input id="hideit" style="display:none !important;" name="hideit" type="text" /> <button class="form-button"><span>Submit</span></button></div>
</form>
<script type="text/javascript">// <![CDATA[
var contactForm = new VarienForm(‘contactForm’, true);
// ]]></script>
And adding fields just put normal fields like how to do it in normal html forms,
then add the variables in the Email Template that you will be using
which can be found at system>email transaction>
next thing is to go to system>Generals>Contacts> setup where the email should be sent.
Displaying Product Images of Associated Products with Configurable Products in Magento
Aug 21st
$assoc_product = Mage::getModel(‘catalog/product’)->load($child->getId());
echo $assoc_product->getName();
foreach($assoc_product->getMediaGalleryImages() as $assoc_product_img){ ?>
<div>
<img src=’<?php echo $this->helper(‘catalog/image’)->init($assoc_product, ‘thumbnail’, $assoc_product_img->getFile())->resize(70, 70); ?>‘ />
</div>
<?php } ?>
The complete snippet is here
$product = Mage::getModel(‘catalog/product’);
$parent = $product->load($_product->getId());
$children = Mage::getModel(‘catalog/product_type_configurable’)->getUsedProductCollection($parent);
$xxx = $parent->getResource()->getAttribute(‘Color’)->getFrontend()->getValue($parent);
foreach($children as $child){
$child = $product->load($child->getId()); ?>
<div>
<a href="<?php echo $this->helper(‘catalog/image’)->init($child, ‘image’); ?>" id="<?php echo "link".$child->getResource()->getAttribute(‘Color’)->getFrontend()->getValue($child); ?>">
<img src="<?php echo $this->helper(‘catalog/image’)->init($child, ‘image’); ?>" id="<?php echo "img".$child->getResource()->getAttribute(‘Color’)->getFrontend()->getValue($child); ?>" />
</a>
<?php
$assoc_product = Mage::getModel(‘catalog/product’)->load($child->getId());
echo $assoc_product->getName();
foreach($assoc_product->getMediaGalleryImages() as $assoc_product_img){ ?>
<div>
<img src=’<?php echo $this->helper(‘catalog/image’)->init($assoc_product, ‘thumbnail’, $assoc_product_img->getFile())->resize(70, 70); ?>‘ />
</div>
<?php } ?>
</div>
<?php } ?>
How to layout Webpages using Photoshop Video Tutorial
Aug 1st
For young aspiring web developers, here is how to layout your homepage using photoshop,
just remember, for a typical and standard web page layout, the page is divided into
- header – where your logo, how to contact information and search or newsletter widgets should be located
- menu – your main navigation, this could be displayed horizontally or vertically (as a sidebar ).
- content – Main content of your homepage or subpages, this can be the location for your images and banners also.
- footer – your copyright, sitemap, terms and conditions , website policy and more, you can also put your website widgets here.
NOTE: If your layout is going to be a multiple column website, the same technique is also applicable, its just that you will just add side bars to your content, its either, 2 column to 3 column webpage.
webpage design tutorial from julius bacosa on Vimeo.
Next Video is how to convert this into HTML / CSS
Color Switcher for Configurable Products, Magento, Prototype Javascript , Php
Jul 24th
I have successfully Implemented the color switcher in Magento,
Although this is not an extension yet you can follow the steps that I did to achieve the functionality.
If you want the implementation to be fast. Feel free to drop me an email, if I am not busy the implementation is free, but if I am loaded with projects then ofcourse 500usd for this custom module
anyway here we go.
1. create color thumbnails for your products (e.g. green, red, blue, yellow)
2. upload this thumbnails to your skin template (e.g. images/swatch/ ..the thumbnails… )
3. add the colors to your color attribute in the configurable products attribute set.
4. The Coding Part. Oh my God this is quite long…
4.1 In your configurable.phtml,
create filter to display the color thumbnails
<tr>
<td>
<select name="super_attribute[<?php echo $_attribute->getAttributeId() ?>]" id="attribute<?php echo $_attribute->getAttributeId() ?>" class="required-entry super-attribute-select">
<option><?php echo $_attribute->getLabel() ?></option>
</select>
</td>
<td>
<?php if($_attribute->getLabel() == "Color"){?>
<script language="javascript">
function createSwatch() {
var selObjg = document.getElementById(’attribute<?php echo $_attribute->getAttributeId() ?>‘);
var jswatchDiv = document.getElementById(’jswatch’);
var textx;
var A= selObjg.options, L= A.length;
for(var ix=1;ix<L;ix++){
jswatchDiv.innerHTML += ‘<img style="padding-left:5px;" src="/store/skin/frontend/default/modern/jimages/swatches/’ + A[ix].text + ‘.jpg" onclick="selectOption(’ + A[ix].value + ‘);
switchPrimary(\” + A[ix].text + ‘\’);" />’;
}
}window.onload=createSwatch;
function switchPrimary(numx){
var primeImage = document.getElementById(’img’+numx);
var primeLink = document.getElementById(’link’+numx);
$(’image’).src = primeLink.href; $(’imagex’).src = primeLink.href; return false;
}
function selectOption(num)
{
var selObj = document.getElementById(’attribute<?php echo $_attribute->getAttributeId() ?>‘);
var A= selObj.options, L= A.length;
while(L){
if (A[--L].value== num){
selObj.selectedIndex= L;
spConfig.atik(selObj);
L= 0;
}
}
activateSizeDDL();
}
</script>
<div id="jswatch" style="padding:5px;"></div>
<?php } ?>
</td>
</tr>
</table>
spConfig.atik(selObj); this will be in product.js in js/varien/
was already declared inside configurable.phtml
in Product.js put this function inside the Product.Config.prototype
this.reloadOptionLabels(element);
if(element.value){
this.state[element.config.id] = element.value;
if(element.nextSetting){
element.nextSetting.disabled = false;
this.fillSelect(element.nextSetting);
this.resetChildren(element.nextSetting);
}
}
else {
this.resetChildren(element);
}
this.reloadPrice();
}
The Image swatcher script is done by a jquery swatcher plugin but you can search it yourself in the internet. I only post this solution since I can’t find any solution to what I want to achieve..
Hope this helps somebody OUTTTTHEEEERREE!!!!
Response.Redirect using Javascript
Dec 8th
window.location = "http://www.adtweeting.com/confirmation.php";
</script>
Super script sup issue on IE8 solution
Dec 7th
font-size:10px;
bottom:10px;
height:10px;
vertical-align: super ;
}
The model item passed into the dictionary is of type ‘mvc.Models.Pagex’ but this dictionary requires a model item of type ‘System.Collections.Generic.IEnumerable`1[mvc.Models.Pagex]‘.
Dec 5th
The model item passed into the dictionary is of type ‘mvc.Models.Pagex’ but this dictionary requires a model item of type ‘System.Collections.Generic.IEnumerable`1[mvc.Models.Pagex]‘.
I encountered this error while trying to render an asp.net mvc application.
The problem: I have 2 partial views, partial view to render the list and the partial view to render the entity item.
like: products/menu : partial view 1: – to render the list of items
shared/menu : partial view 2: – to render entity item
solution to the problem: I changed the name of one of these partial views then my project then rendered ok.
