VirtueMart Forum

VirtueMart 2 + 3 + 4 => Templating & Layouts => Topic started by: r_ekkie on August 14, 2013, 15:40:03 PM

Title: changing add to cart popup
Post by: r_ekkie on August 14, 2013, 15:40:03 PM
I'm using the great fancybox for the add to cart.

but is there allready anybody that knows how I can add the following things in padded.php?:

product picture, and price for the added product


add to cart button and prices for the related products in the fancybox

Thanks
Title: Re: changing add to cart popup
Post by: Maxim Pishnyak on August 14, 2013, 21:30:09 PM
Did you try to dig that file? Maybe you saw there row that displays product sku?
Title: Re: changing add to cart popup
Post by: r_ekkie on August 15, 2013, 05:57:46 AM
openingen the file. I cannot see any row displaying the product sku. I only see the related product and the row telling product is added or the number being changed.

thanks
Title: Re: changing add to cart popup
Post by: Maxim Pishnyak on August 15, 2013, 10:30:20 AM
Just checked. I saw there words about product name. Now try to go further.
Title: Re: changing add to cart popup
Post by: jenkinhill on August 15, 2013, 11:01:18 AM
Quote from: r_ekkie on August 14, 2013, 15:40:03 PM
add to cart button and prices for the related products in the fancybox

I don't think that can be done as it will be using nested AJAX calls - would need extensive JavaScript rewriting.

As for showing product image & price I suppose that could be coded as the product id and price are available in the session, but it would take some time - how long depends on your skill level. Maybe see if any of these calls work on padded.php - http://forum.virtuemart.net/index.php?topic=92756.0
Personally I can't see the need for it as the product image and price will be visible behind the popup.
Title: Re: changing add to cart popup
Post by: Zegenrijk on September 25, 2013, 11:23:42 AM
See this solution to add related products price, discount amount, salesprice.

<?php
/**
*
* Layout for the add to cart popup
*
* @package VirtueMart
* @subpackage Cart
* @author Max Milbers
*
* @link http://www.virtuemart.net
* @copyright Copyright (c) 2013 VirtueMart Team. All rights reserved.
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL, see LICENSE.php
* VirtueMart is free software. This version may have been modified pursuant
* to the GNU General Public License, and as distributed it includes or
* is derivative of works licensed under the GNU General Public License or
* other free or open source software licenses.
* @version $Id: cart.php 2551 2010-09-30 18:52:40Z milbo $
*/

// Check to ensure this file is included in Joomla!
defined('_JEXEC') or die('Restricted access');

echo 
'<a class="continue" href="' $this->continue_link '" >' JText::_('COM_VIRTUEMART_CONTINUE_SHOPPING') . '</a>';
echo 
'<a class="showcart floatright" href="' $this->cart_link '">' JText::_('COM_VIRTUEMART_CART_SHOW') . '</a>';
if(
$this->product){
echo '<h4>'.JText::sprintf('COM_VIRTUEMART_CART_PRODUCT_ADDED',$this->product->product_name,$this->product->quantity).'</h4>';
}

if (
$this->errorMsg) echo '<div>'.$this->errorMsg.'</div>';




defined '_JEXEC' ) or die ( 'Restricted access' );
$model = new VirtueMartModelProduct();
$calculator calculationHelper::getInstance();
$currency CurrencyDisplay::getInstance();
?>

        <div class="product-related-products">
   

    <?php
    
foreach ($this->product->customfieldsRelatedProducts as $field) {
    if(!empty($field->display)) {
?>
<div class="product-field product-field-type-<?php echo $field->field_type ?>">
    <span class="product-field-display" style="min-height:200px"><?php echo $field->display ?></span>

  <span class="product-field-desc"><?php

echo jText::_($field->custom_field_desc);

$product $model->getProductSingle($field->custom_value,false);
$price $calculator -> getProductPrices($product);
echo 
'<span class="rel_sp" >' .  $currency->priceDisplay($price['salesPrice']) . "</span>";
echo 
'<span class="rel_price-cros" >' .  $currency->priceDisplay($price['basePriceWithTax']) . "</span>";
echo 
'<span class="rel_discount" >SAVE: ' .  $currency->priceDisplay($price['discountAmount']) . "</span>";
?>

</span>

</div>


<?php }
    } ?>

        </div>

<br style="clear:both">
Title: Re: changing add to cart popup
Post by: wdad on September 25, 2013, 13:17:00 PM
Hallo Zegenrijk,

wich file is this?

Thanks, Helmut
Title: Re: changing add to cart popup
Post by: wdad on September 25, 2013, 15:30:41 PM
now i found padded.php
Is it possible to insert a button like "add to cart"?