News:

You may pay someone to create your store, or you visit our seminar and become a professional yourself with the silver certification

Main Menu

Cart Module not updating

Started by sscheidegger, May 16, 2014, 15:21:30 PM

Previous topic - Next topic

gripped

In chromium. Right click , Inspect element, Console.
Error log should be on the the server. Where depends on the server settings.

ifs-net

#16
Quote from: Milbo on May 21, 2014, 16:00:55 PM
Just replace the $lang-> by vmText:: that should be the correct fix

Hello,

Mine is already "wmText" but I have a similar problem

www.enmodabutik.com

- when your cart is empty, when you click "add to cart" on an item page, fancybox is coming and if you wait 2 seconds cart modul icon dissapears...
- when there is an item in your cart and you click "add to cart" for an other item, this time module icon dissapears and module text becomes unlinkable...

I need help please

My config is, VirtueMart 2.6.12.2 & Joomla! 2.5.27

Milbo

Very likely a jquery problem. Disable your template and use the standard template to check if your template is responsible for it.
Should I fix your bug, please support the VirtueMart project and become a member
______________________________________
Extensions approved by the core team: http://extensions.virtuemart.net/

ifs-net

Hi,
Thanks for your quick reply.

I am not able to understand if it is a template error or not..
I tried with beez5 and atomic templates but there is no fancy box coming when I click add to cart...

Milbo

Should I fix your bug, please support the VirtueMart project and become a member
______________________________________
Extensions approved by the core team: http://extensions.virtuemart.net/

ifs-net

Milbo,

You have 100% right..
This is a template issue.

I installed an other virtuemart template and there is no problem, it is working fine in any case.

But I am not able to take any support from http://www.virtuemarttemplates.net/
I do not know how to fix it...
The problem is that I finished all site and it is live... The only problem left is this one..

jenkinhill

And it looks like virtuemarttemplates.net hide their identity and real address so you can't send the boys round to sort them out. That would be illegal in Europe where a real contact address & phone number must be published.

Good luck sorting them out.
Kelvyn
Lowestoft, Suffolk, UK

Retired from forum life November 2023

Please mention your VirtueMart, Joomla and PHP versions when asking a question in this forum

Milbo

Go in the template file, and check there is somewhere (at the end of the file) an entry for jquery, just delete it.
Should I fix your bug, please support the VirtueMart project and become a member
______________________________________
Extensions approved by the core team: http://extensions.virtuemart.net/

ifs-net

Hi Milbo,

Thanks a lot for your help.

I tried to remove this one;


<script type="text/javascript">
jQuery(document).ready(function() {
jQuery('#cartpanel').on('click', function() {
jQuery('div.panel2').animate({
'height': 'show'
}, 300, function() {
jQuery('div.cartpanel').fadeIn(200);
});
});
jQuery('span.closecart').on('click', function() {
jQuery('div.cartpanel').fadeOut(200, function() {
jQuery('div.panel2').animate({
'height': 'hide'
}, 300);
});
});
});
</script>


which is under "/home/medisana/public_html/templates/flat/html/mod_virtuemart_cart/default.php"

But It has not work... I will have a look at the other files...

ifs-net

Maybe this one is the right file to fix ?
"/home/medisana/public_html/templates/flat/html/com_virtuemart/productdetails/default.php"


<?php
defined
('_JEXEC') or die('Restricted access');

// addon for joomla modal Box
JHTML::_('behavior.modal');
// JHTML::_('behavior.tooltip');
if(VmConfig::get('usefancy',1)){
vmJsApi::js'fancybox/jquery.fancybox-1.3.4.pack');
vmJsApi::css('jquery.fancybox-1.3.4');
$box "$.fancybox({
href: '" 
$this->askquestion_url "',
type: 'iframe',
height: '550'
});"
;
} else {
vmJsApi::js'facebox' );
vmJsApi::css'facebox' );
$box "$.facebox({
iframe: '" 
$this->askquestion_url "',
rev: 'iframe|550|550'
});"
;
}
$document JFactory::getDocument();
$document->addScriptDeclaration("
//<![CDATA[
jQuery(document).ready(function($) {
$('a.ask-a-question').click( function(){
"
.$box."
return false ;
});
/* $('.additional-images a').mouseover(function() {
var himg = this.href ;
var extension=himg.substring(himg.lastIndexOf('.')+1);
if (extension =='png' || extension =='jpg' || extension =='gif') {
$('.main-image img').attr('src',himg );
}
console.log(extension)
});*/
});
//]]>
"
);
/* Let's see if we found the product */
if (empty($this->product)) {
    echo 
JText::_('COM_VIRTUEMART_PRODUCT_NOT_FOUND');
    echo 
'<br /><br />  ' $this->continue_link_html;
    return;
}

?>


<div class="productdetails-view productdetails">

    <?php
    
// Product Navigation
    
if (VmConfig::get('product_navigation'1)) {
?>

        <div class="product-neighbours">
    <?php
    if (!empty(
$this->product->neighbours ['previous'][0])) {
$prev_link JRoute::_('index.php?option=com_virtuemart&view=productdetails&virtuemart_product_id=' $this->product->neighbours ['previous'][0] ['virtuemart_product_id'] . '&virtuemart_category_id=' $this->product->virtuemart_category_id);
echo JHTML::_('link'$prev_link$this->product->neighbours ['previous'][0]
['product_name'], array('class' => 'previous-page'));
    }
    if (!empty($this->product->neighbours ['next'][0])) {
$next_link JRoute::_('index.php?option=com_virtuemart&view=productdetails&virtuemart_product_id=' $this->product->neighbours ['next'][0] ['virtuemart_product_id'] . '&virtuemart_category_id=' $this->product->virtuemart_category_id);
echo JHTML::_('link'$next_link$this->product->neighbours ['next'][0] ['product_name'], array('class' => 'next-page'));
    }
    ?>

    <div class="clear"></div>
        </div>
    <?php // Product Navigation END
    
?>


    <?php // Product Title   ?>
    <h1><?php echo $this->product->product_name ?> <?php echo $this->edit_link?></h1>
    <?php // Product Title END   ?>

    <?php // afterDisplayTitle Event
    
echo $this->product->event->afterDisplayTitle ?>


    <?php

    
if (!empty($this->product->customfieldsSorted['ontop'])) {
$this->position 'ontop';
echo $this->loadTemplate('customfields');
    } 
// Product Custom ontop end
    
?>


<div class="row-fluid product-additional-nav">
<div class="span6">
<?php // Back To Category Button
if ($this->product->virtuemart_category_id) {
$catURL =  JRoute::_('index.php?option=com_virtuemart&view=category&virtuemart_category_id='.$this->product->virtuemart_category_id);
$categoryName $this->product->category_name ;
} else {
$catURL =  JRoute::_('index.php?option=com_virtuemart');
$categoryName jText::_('COM_VIRTUEMART_SHOP_HOME') ;
}
?>

<div class="back-to-category">
<a href="<?php echo $catURL ?>" class="" title="<?php echo $categoryName ?>"><?php echo JText::sprintf('COM_VIRTUEMART_CATEGORY_BACK_TO',$categoryName?></a>
</div>
</div>
<div class="span6">
<?php
// PDF - Print - Email Icon
if (VmConfig::get('show_emailfriend') || VmConfig::get('show_printicon') || VmConfig::get('pdf_button_enable')) {
?>

<div class="icons hidden-phone">
<?php
//$link = (JVM_VERSION===1) ? 'index2.php' : 'index.php';
$link 'index.php?tmpl=component&option=com_virtuemart&view=productdetails&virtuemart_product_id=' $this->product->virtuemart_product_id;
$MailLink 'index.php?option=com_virtuemart&view=productdetails&task=recommend&virtuemart_product_id=' $this->product->virtuemart_product_id '&virtuemart_category_id=' $this->product->virtuemart_category_id '&tmpl=component';

if (VmConfig::get('pdf_icon'1) == '1') {
echo "<span class=\"vm-pdf-button\">".$this->linkIcon($link '&format=pdf''COM_VIRTUEMART_PDF''pdf_button''pdf_button_enable'false)."</span>";
}
echo "<span class=\"vm-print-button\">".$this->linkIcon($link '&print=1''COM_VIRTUEMART_PRINT''printButton''show_printicon')."</span>";
echo "<span class=\"vm-email-button\">".$this->linkIcon($MailLink'COM_VIRTUEMART_EMAIL''emailButton''show_emailfriend')."</span>";
?>

<div class="clear"></div>
</div>
<?php // PDF - Print - Email Icon END
?>

</div>
</div>

    <div class="row-fluid">
<div class="span6 floatleft">
<?php echo $this->loadTemplate('images'); ?>

<?php
if ($this->showRating) {
    $maxrating VmConfig::get('vm_maximum_rating_scale'5);

    if (empty($this->rating)) {
?>

<span class="vote"><?php echo JText::_('COM_VIRTUEMART_RATING') . ' ' JText::_('COM_VIRTUEMART_UNRATED'?></span>
    <?php
} else {
    $ratingwidth $this->rating->rating 24//I don't use round as percetntage with works perfect, as for me
    ?>

<span class="vote">
<?php echo JText::_('COM_VIRTUEMART_RATING') . ' ' round($this->rating->rating) . '/' $maxrating?> <span title=" <?php echo (JText::_("COM_VIRTUEMART_RATING_TITLE") . round($this->rating->rating) . '/' $maxrating?>" class="ratingbox" style="display:inline-block;">
<span class="stars-orange" style="width:<?php echo $ratingwidth.'px'?>">
</span>
    </span>
</span>
<?php
    }
}
?>


</div>

<div class="span6 floatright">
    <div class="spacer-buy-area">

<?php
// TODO in Multi-Vendor not needed at the moment and just would lead to confusion
/* $link = JRoute::_('index2.php?option=com_virtuemart&view=virtuemart&task=vendorinfo&virtuemart_vendor_id='.$this->product->virtuemart_vendor_id);
  $text = JText::_('COM_VIRTUEMART_VENDOR_FORM_INFO_LBL');
  echo '<span class="bold">'. JText::_('COM_VIRTUEMART_PRODUCT_DETAILS_VENDOR_LBL'). '</span>'; ?>
<a class="modal" href="<?php echo $link ?>"><?php echo $text ?></a><br />
*/

// Product Short Description
if (!empty($this->product->product_s_desc)) {
?>
<div class="product-short-description"><span class="module-arrow"></span>
<?php
/** @todo Test if content plugins modify the product description */
echo nl2br($this->product->product_s_desc);
?>

</div>
<?php
// Product Short Description END
 
?>


<?php
// Manufacturer of the Product
if (VmConfig::get('show_manufacturers'1) && !empty($this->product->virtuemart_manufacturer_id)) {
    echo $this->loadTemplate('manufacturer');
}
?>


<?php

if (is_array($this->productDisplayShipments)) {
    foreach ($this->productDisplayShipments as $productDisplayShipment) {
echo $productDisplayShipment '<br />';
    }
}
if (is_array($this->productDisplayPayments)) {
    foreach ($this->productDisplayPayments as $productDisplayPayment) {
echo $productDisplayPayment '<br />';
    }
}
// Product Price
    // the test is done in show_prices
//if ($this->show_prices and (empty($this->product->images[0]) or $this->product->images[0]->file_is_downloadable == 0)) {
    echo $this->loadTemplate('showprices');
//}
?>


<?php
// Add To Cart Button
//  if (!empty($this->product->prices) and !empty($this->product->images[0]) and $this->product->images[0]->file_is_downloadable==0 ) {
if (!VmConfig::get('use_as_catalog'0) and !empty($this->product->prices['salesPrice'])) {
    echo $this->loadTemplate('addtocart');
}  // Add To Cart Button END
?>


<?php
// Ask a question about this product
if (VmConfig::get('ask_question'1) == 1) {
    
?>

    <div class="ask-a-question">
        <a class="ask-a-question" href="<?php echo $this->askquestion_url ?>" ><?php echo JText::_('COM_VIRTUEMART_PRODUCT_ENQUIRY_LBL'?></a>
        <!--<a class="ask-a-question modal" rel="{handler: 'iframe', size: {x: 700, y: 550}}" href="<?php echo $this->askquestion_url ?>"><?php echo JText::_('COM_VIRTUEMART_PRODUCT_ENQUIRY_LBL'?></a>-->
    </div>
<?php }
?>


<?php
// Availability Image
$stockhandle VmConfig::get('stockhandle''none');
if (($this->product->product_in_stock $this->product->product_ordered) < 1) {
if ($stockhandle == 'risetime' and VmConfig::get('rised_availability') and empty($this->product->product_availability)) {
?>
<div class="availability">
    <?php echo (file_exists(JPATH_BASE DS VmConfig::get('assets_general_path') . 'images/availability/' VmConfig::get('rised_availability'))) ? JHTML::image(JURI::root() . VmConfig::get('assets_general_path') . 'images/availability/' VmConfig::get('rised_availability''7d.gif'), VmConfig::get('rised_availability''7d.gif'), array('class' => 'availability')) : VmConfig::get('rised_availability'); ?>
</div>
    <?php
} else if (!empty($this->product->product_availability)) {
?>

<div class="availability">
<?php echo (file_exists(JPATH_BASE DS VmConfig::get('assets_general_path') . 'images/availability/' $this->product->product_availability)) ? JHTML::image(JURI::root() . VmConfig::get('assets_general_path') . 'images/availability/' $this->product->product_availability$this->product->product_availability, array('class' => 'availability')) : $this->product->product_availability?>
</div>
<?php
}
}
?>


    </div>
</div>
<div class="clear"></div>
    </div>

<?php // event onContentBeforeDisplay
echo $this->product->event->beforeDisplayContent?>


<?php
// Product Description
if (!empty($this->product->product_desc)) {
    ?>

        <div class="product-description">
<?php /** @todo Test if content plugins modify the product description */ ?>
    <span class="title"><?php echo JText::_('COM_VIRTUEMART_PRODUCT_DESC_TITLE'?></span>
<?php echo $this->product->product_desc?>
        </div>
<?php
    
// Product Description END

    
if (!empty($this->product->customfieldsSorted['normal'])) {
$this->position 'normal';
echo $this->loadTemplate('customfields');
    } 
// Product custom_fields END
    // Product Packaging
    
$product_packaging '';
    if (
$this->product->product_box) {
?>

        <div class="product-box">
    <?php
        echo 
JText::_('COM_VIRTUEMART_PRODUCT_UNITS_IN_BOX') .$this->product->product_box;
    ?>

        </div>
    <?php // Product Packaging END
    
?>


    <?php
    
// Product Files
    // foreach ($this->product->images as $fkey => $file) {
    // Todo add downloadable files again
    // if( $file->filesize > 0.5) $filesize_display = ' ('. number_format($file->filesize, 2,',','.')." MB)";
    // else $filesize_display = ' ('. number_format($file->filesize*1024, 2,',','.')." KB)";

    /* Show pdf in a new Window, other file types will be offered as download */
    // $target = stristr($file->file_mimetype, "pdf") ? "_blank" : "_self";
    // $link = JRoute::_('index.php?view=productdetails&task=getfile&virtuemart_media_id='.$file->virtuemart_media_id.'&virtuemart_product_id='.$this->product->virtuemart_product_id);
    // echo JHTMl::_('link', $link, $file->file_title.$filesize_display, array('target' => $target));
    // }
    
if (!empty($this->product->customfieldsRelatedProducts)) {
echo $this->loadTemplate('relatedproducts');
    } 
// Product customfieldsRelatedProducts END

    
if (!empty($this->product->customfieldsRelatedCategories)) {
echo $this->loadTemplate('relatedcategories');
    } 
// Product customfieldsRelatedCategories END
    // Show child categories
    
if (VmConfig::get('showCategory'1)) {
echo $this->loadTemplate('showcategory');
    }
    if (!empty(
$this->product->customfieldsSorted['onbot'])) {
    
$this->position='onbot';
    
echo $this->loadTemplate('customfields');
    } 
// Product Custom ontop end
    
?>


<?php // onContentAfterDisplay event
echo $this->product->event->afterDisplayContent?>


<?php
echo $this->loadTemplate('reviews');
?>

</div>


ifs-net

That must be somewhere in that file... I think I need to put a refresh function for the cart... Or I need to delete the duplicated script...
"/home/medisana/public_html/templates/flat/html/mod_virtuemart_cart/default.php"


<?php // no direct access
defined('_JEXEC') or die('Restricted access');
?>


<div class="vmCartModule <?php echo $params->get('moduleclass_sfx'); ?>" id="vmCartModule">

<?php if ($data->totalProduct and $show_price) { ?><div class="show-both"><?php ?>
<div class="total_products">
<?php if ($data->totalProduct>1$data->totalProductTxt2 '<div class="total-items">'.JText::sprintf('TPL_FLAT_ITEM_S'$data->totalProduct).'</div>';
else if (
$data->totalProduct == 1$data->totalProductTxt2 '<div class="total-items">'.JText::_('TPL_FLAT_ITEM').'</div>';
else 
$data->totalProductTxt2 '<a href="#" class="cart-button"><div class="popover bottom"><div class="arrow"></div><div class="popover-content"><p>'.JText::_('COM_VIRTUEMART_EMPTY_CART').'</p></div></div></a>';
echo 
$data->totalProductTxt2?>


</div>

<?php if ($data->totalProduct and $show_price) { ?></div><?php ?>
<?php if ($data->totalProduct and $show_price) { ?>
<div class="show-cart"><a id="cartpanel" class="cart-button" href="javascript:void(0);"><?php echo JText::_('COM_VIRTUEMART_CART_SHOW'?></a></div>

<?php if ($show_product_list) { ?>

<div class="panel2">
<div class="cartpanel">
<span class="closecart">&times;</span>
<div class="arrow"></div>
<?php if ($data->totalProduct and $show_price) echo "<span class=\"show-cart-link\">".$data->cart_show."</span>"?>

<div id="hiddencontainer" style="display: none; ">
<div class="cart-container">
<?php if ($show_price) { ?>
  <div class="prices" style="float: right;"></div>
<?php ?>
<div class="product_row">
<span class="quantity"></span>&nbsp;x&nbsp;<span class="product_name"></span>
</div>

<div class="product_attributes"></div>
</div>
</div>
<div class="vm_cart_products">
<div class="cart-container">

<?php
foreach ($data->products as $product)
?>
<div class="product-cart-row"> <?php
if ($show_price) { ?>

  <div class="prices" style="float: right;"><?php echo  $product['prices'?></div>
<?php ?>
<div class="product_row">
<span class="quantity"><?php echo  $product['quantity'?></span>&nbsp;x&nbsp;<span class="product_name"><?php echo  $product['product_name'?></span>
</div>
<?php if ( !empty($product['product_attributes']) ) { ?>
<div class="product_attributes"><?php echo $product['product_attributes'?></div>

<?php ?>
</div>
<?php
}
?>

</div>
</div>

<div class="total"><?php if ($data->totalProduct and $show_price) echo  $data->billTotal?></div>

</div>
</div>

<script type="text/javascript">
jQuery(document).ready(function() {
jQuery('#cartpanel').on('click', function() {
jQuery('div.panel2').animate({
'height': 'show'
}, 300, function() {
jQuery('div.cartpanel').fadeIn(200);
});
});
jQuery('span.closecart').on('click', function() {
jQuery('div.cartpanel').fadeOut(200, function() {
jQuery('div.panel2').animate({
'height': 'hide'
}, 300);
});
});
});
</script>

<?php ?>
<?php ?>


<noscript>
<?php echo JText::_('MOD_VIRTUEMART_CART_AJAX_CART_PLZ_JAVASCRIPT'?>
</noscript>
</div>






ifs-net

When I check the page source of product page (or fancybox) with the browser, I can see that there are too many scripts, but I do not know which one is conflicting, and where can I find and delete it


  <script src="//ajax.googleapis.com/ajax/libs/jquery/1.8.1/jquery.min.js?vmver=Revision: 8558" type="text/javascript"></script>
  <script src="/components/com_virtuemart/assets/js/jquery.noconflict.js?vmver=Revision: 8558" type="text/javascript"></script>
  <script src="/components/com_virtuemart/assets/js/vmsite.js?vmver=Revision: 8558" type="text/javascript"></script>
  <script src="/components/com_virtuemart/assets/js/fancybox/jquery.fancybox-1.3.4.pack.js?vmver=Revision: 8558" type="text/javascript"></script>
  <script src="/components/com_virtuemart/assets/js/vmprices.js?vmver=Revision: 8558" type="text/javascript"></script>
  <script src="/media/system/js/mootools-core.js" type="text/javascript"></script>
  <script src="/media/system/js/core.js" type="text/javascript"></script>
  <script src="/media/system/js/modal.js" type="text/javascript"></script>
  <script src="/templates/flat/js/jquery.elevateZoom-3.0.8.min.js" type="text/javascript"></script>
  <script src="/components/com_jfbconnect/includes/jfbconnect.js?v=6" type="text/javascript"></script>
  <script src="/media/sourcecoast/js/jq-bootstrap-1.8.3.js" type="text/javascript"></script>
  <script src="/media/system/js/mootools-more.js" type="text/javascript"></script>
  <script type="text/javascript">


I need some help please

ifs-net

Hi,

I need help please ...
I am also open for professional help. I can pay for the fix.
I will appreciate if someone can help me to fix it.
Thanks a lot

ifs-net

OK So step step by step I am coming to the solution I guess.
I have checked a product page with firebug. And the error message I am getting is this;
"Error: You must specify a valid JavaScript API Domain as part of this key's configuration."

So now I need to learn where is coming this and how to solve....

ifs-net

Quote from: ifs-net on December 23, 2014, 22:14:30 PM
OK So step step by step I am coming to the solution I guess.
I have checked a product page with firebug. And the error message I am getting is this;
"Error: You must specify a valid JavaScript API Domain as part of this key's configuration."

So now I need to learn where is coming this and how to solve....

It looks that this has no relation with the problem, this is a problem about linkedin API

AND THERE IS NO OTHER ERROR SEEN ON FIREBUG.


WORST TEMPLATE EVER http://virtuemarttemplates.net/