Author Topic: [SOLVED]put product_type between attributes and quantity box.  (Read 1390 times)

useris

  • Jr. Member
  • **
  • Posts: 224
Hi,

I am trying to customize VM template file addtocart_tpl.php I want product type to be shown between product attributes and quantity box. But i haven't succeed
Code: [Select]
<form action="<?php echo $mm_action_url ?>index.php" method="post" name="addtocart" id="addtocart<?php echo $i ?>" class="addtocart_form" <?php if( $this->get_cfg'useAjaxCartActions') && !$notify ) { echo 'onsubmit="handleAddToCart( this.id );return false;"'; } ?>>
<?php echo $ps_product_attribute->list_advanced_attribute($product_id);?><br />

<div> <?php echo $ps_product_attribute->show_quantity_box($product_id,$product_id); ?><input type="submit" class="<?php echo $button_cls ?>" value="<?php echo $button_lbl ?>" /></div>
<input type="hidden" name="category_id" value="<?php echo  @$_REQUEST['category_id'?>" />
I tried to insert $product_type between attribute and quantity but it does not show up. But if I just type something in there it will be shown on product browse or flypage.
Can you help me how to achieve it?

useris

  • Jr. Member
  • **
  • Posts: 224
Re: put product_s_desc between attributes and quantity box.
« Reply #1 on: June 25, 2011, 15:28:06 pm »
All right, I will put this question in the other way :)

How to insert <?php echo $product_type ?> into file addtocart_form.tpl.php
I tried but not working for me, produc type not showing up.
For example. if I add line:
$product_type = $ps_product_type->list_product_type($flerd_product_id);
to addtocart_tpl.php then I can see just my product type name but I can't see values (of product _type)
Probably I need to edit shop.browse.php too???

useris

  • Jr. Member
  • **
  • Posts: 224
Re: put product_type between attributes and quantity box.
« Reply #2 on: June 25, 2011, 16:40:45 pm »
I found something. In the browse page there is a line <?php echo $form_addtocart ?> so if I change it to
Code: [Select]
<form action="<?php echo $mm_action_url ?>index.php" method="post" name="addtocart" id="addtocart<?php echo $i ?>" class="addtocart_form" <?php if( $this->get_cfg'useAjaxCartActions') && !$notify ) { echo 'onsubmit="handleAddToCart( this.id );return false;"'; } ?>>
<?php echo $ps_product_attribute->list_advanced_attribute($product_id);?><br />
<div> <?php echo $product_type ?></div>

<div> <?php echo $ps_product_attribute->show_quantity_box($product_id,$product_id); ?><input type="submit" class="<?php echo $button_cls ?>" value="<?php echo $button_lbl ?>" /></div>

    <input type="hidden" name="category_id" value="<?php echo  @$_REQUEST['category_id'?>" />
    <input type="hidden" name="product_id" value="<?php echo $product_id ?>" />
    <input type="hidden" name="prod_id[]" value="<?php echo $product_id ?>" />
    <input type="hidden" name="page" value="shop.cart" />
    <input type="hidden" name="func" value="cartadd" />
    <input type="hidden" name="Itemid" value="<?php echo $sess->getShopItemid() ?>" />
    <input type="hidden" name="option" value="com_virtuemart" />
    <input type="hidden" name="set_price[]" value="" />
    <input type="hidden" name="adjust_price[]" value="" />
    <input type="hidden" name="master_product[]" value="" />
</form>
The product type is showing between attributes and quantity box. But now other problem :) not all product are added to the cart.