Please include your version of Joomla, Moodle and Joomdle when seeking assistance.  Also, if you do not get an immediate response, do not bump your posting as it will be deleted.


Remember Joomdle is a free extension and the Joomdle Team has 'day time' jobs as well.

Thanks for your understanding

Welcome, Guest
Username: Password: Remember me
Tips & Tricks
  • Page:
  • 1

TOPIC: VM Addtocart Button in JOOMDLE Course Details Page

VM Addtocart Button in JOOMDLE Course Details Page 2 years 6 months ago #1



File: joomla\components\com_joomdle\views\detail\tmpl\default.php
$shop_pid = JRoute::_(JoomdleHelperShop::get_shop_pid ($course_info['remoteid']));
<form action="http://localhost/joomla/index.php" method="post" name="addtocart" id="addtocart_4cdc516ccdd7d" class="addtocart_form" onsubmit="handleAddToCart( this.id );return false;">
			<input type="hidden" name="prod_id[]" value="<?php echo $shop_pid; ?>" />
             <input type="hidden" id="quantity9" name="quantity[]" value="1" /> 
            <input type="hidden" name="option" value="com_virtuemart" />
            <input type="hidden" name="flypage" value="shop.flypage.tpl" />
            <input type="hidden" name="page" value="shop.cart" />
            <input type="hidden" name="Itemid" value="1" />
            <input type="hidden" name="func" value="cartAdd" />
            <input type="submit" class="addtocart_button_module" value="Add to Cart" title="Buy this" />
</form>



File: joomla\administrator\components\com_joomdle\helpers\shop.php
function get_shop_pid ($course_id)
	{
		$db           =& JFactory::getDBO();
		$query = 'SELECT product_id' .
                                ' FROM #__vm_product' .
                                ' WHERE product_sku =';
		$query .= $db->Quote($course_id) . " and product_publish='Y'";
		$db->setQuery($query);
		$product = $db->loadObjectList();
		$product_id = $product[0]->product_id;
		$shop_pid ="$product_id";
		return $shop_pid;
	}
Shekar
Last Edit: 2 years 6 months ago by shekar.
The administrator has disabled public write access.

Re: VM Addtocart button in JOOMLDE Course Details Page 2 years 6 months ago #2

Thank you very much for your contribution.

I will test it as soon as I have the time, and include it for next release.

Thanks again,
Antonio
The administrator has disabled public write access.

Re: VM Addtocart button in JOOMLDE Course Details Page 1 year 1 month ago #3

Antonio, this function are planned to release 0.8?

Thank you

Paulo
The administrator has disabled public write access.

Re: VM Addtocart button in JOOMLDE Course Details Page 1 year 1 month ago #4

No, this was finally not included.

I think it would be better to implement this as a plugin.... will think about it for a future release.
The administrator has disabled public write access.
The following user(s) said Thank You: Paulo Cezar Diniz Junior

Re: VM Addtocart button in JOOMLDE Course Details Page 1 year 1 month ago #5

Sounds good, should be better.
The administrator has disabled public write access.
  • Page:
  • 1
Time to create page: 0.298 seconds