I haev added a new product variation and supporting content type, but it seems these product type are not themed in theme.
I have already created a product node template file for new product. It seem add to cart form template also need to chnaged for this vaiation type.
Please provide me what chnages I need to do in add to cart form template file
Hello,
Please send the page that you have problem with it.
Thank you!
I have added the snapshot here.as this node is not yet published i cant show the page to you to you.as you can see the add to cart form is not shown here properly
Hello,
Please give me your website account. Remember to set your message as private.
Thanks!
Hello,
I have logged into your site but I can't see the admin menu bar? Or I do not have the privilege?
Thanks!
I didnt get u the admin access.. as this is the live site containing customer data
do u really need admin access to see the page code.
I can see that the template file commerce-cart-add-to-cart-form.tpl.php has bwlow code
i have marked in bold the code which is having issue, here it is limiting the code to work only with variation 'product'. Please let me know what do chnage here to make it work for all product types
<?php
$product = commerce_product_load((int)$form['product_id']['#value']);
$query = new EntityFieldQuery;
$result = $query->entityCondition('entity_type', 'node', '=')
->propertyCondition('type', 'product')
->fieldCondition('field_product_ref', 'product_id', (int)$form['product_id']['#value'], '=')
->range(0, 1)->execute();
$nids = array();
foreach ($result['node'] as $node) {
$nids[] = $node->nid;
}
$node = node_load((int)$nids[0]);
?>
<?php if (isset($form['#is_product_page']) && $form['#is_product_page'] && isset($form['attributes'])): ?>
<div class="attribute clearfix">
<?php if (isset($form['attributes'])): ?>
<fieldset class="attribute_fieldset">
<label class="attribute_label"><?php print t('Color'); ?>:</label>
<div class="attribute_list">
<ul class="attribute_color">
<?php foreach ($form['attributes']['field_product_colors']['#options'] as $id => $color) : ?>
<?php $color = md_orenmode_get_color($id);?>
<?php if ($id == $form['attributes']['field_product_colors']['#default_value']): ?>
<li class="active"><a href="#" style="background-color: <?php print $color;?>" data-color="<?php print $id; ?>" class="_<?php print $id; ?>"></a></li>
<?php else: ?>
<li><a href="#" style="background-color: <?php print $color;?>" data-color="<?php print $id; ?>" class="_<?php print $id; ?>"></a></li>
<?php endif; ?>
<?php endforeach; ?>
</ul>
</div>
</fieldset>
<fieldset class="attribute_fieldset">
<label class="attribute_label"><?php print t('Size'); ?>:</label>
<div class="attribute_list">
<ul class="attribute_size">
<?php foreach ($form['attributes']['field_product_size']['#options'] as $id => $size) : ?>
<?php if ($id == $form['attributes']['field_product_size']['#default_value']): ?>
<li class="active"><a href="#" data-size="<?php print $id; ?>"><?php print $size; ?></a></li>
<?php else: ?>
<li><a href="#" data-size="<?php print $id; ?>"><?php print $size; ?></a></li>
<?php endif; ?>
<?php endforeach; ?>
</ul>
</div>
</fieldset>
<?php endif; ?>
<div class="js-hide">
<?php print render($form['attributes']) ?>
</div>
</div>
<div class="add-to-box clearfix">
<div class="input-content">
<label for="qty"><?php print t('QTY'); ?>:</label>
<div class="qty-box">
<button class="qty-decrease"> <?php print render($form['quantity']) ?>
<button class="qty-increase"> </div>
</div>
<div class="add-to-cart">
<div class="js-hide"><?php print render($form['submit']) ?></div>
<a href="#" class="btn btn-3 text-uppercase"><i class="fa fa-cart-plus"></i> <span><?php print t('Add To Cart'); ?></span></a>
</div>
<div class="add-to-user">
<?php if(user_is_logged_in()) : ?>
<span class="btn btn-13"><?php print flag_create_link('bookmark', $node->nid); ?></span>
<span class="btn btn-13"><?php print flag_create_link('compare', $node->nid); ?></span>
<?php else : ?>
<a href="<?php print base_path().'user'; ?>" class="btn btn-13"><i class="fa fa-heart-o"></i> <span><?php print t('Add to WishList'); ?></span></a>
<a href="<?php print base_path().'user'; ?>" class="btn btn-13"><i class="fa fa-refresh"></i> <span><?php print t('Add to Compare'); ?></span></a>
<?php endif; ?>
</div>
</div>
<?php endif; ?>
<?php print drupal_render_children($form); ?>
Subscribe.
I have new product display (prod_d) and new product variation (prod_v).
Result:
Where and what needs to change?
Hello,
Okay, you can go to admin/structure/types/manage/product/display. Then click on the widget at the right of Product Ref field. And check to "Show attribute widgets even if the Add to Cart form only represents one product."
Thanks!
I already did
I had already made this chnage , but still it is same.
Hello,
I need FTP and Website account to check and debug. Please create a test site and send me the accessing info.
Thanks!
@Ddr:
Please follow this comment to fix this issue.
http://megadrupal.com/comment/9173#comment-9173
This helps only when adding a new variation, but not for new product display and new product variation
I need to add 5 product displays that have their own variations
I should wait answer?
Ddr,
Could you send us your site url and admin account by private comment? Please remember to backup first.