Linelabox Support

Hello there! Welcome to Linelabox Support Forum. Post your question and our support specialists will help you. Look for the solution in the F.A.Q. first. Our support team is available for any questions or issues in the following working hours: Monday - Friday: 10:00 - 18:00.

Hello,
I use shoplab theme, and my problem is, that in category view, users can add the product to cart without going to the product details page. Quite often they don't reed the details, or don't set all the parameters, so I would like to disable the add to cart function in category view..
Can the "add to cart" button in category view disabled, or be changed to "details", or anything?

kind regards,
Eniko
Responses (3)
  • Accepted Answer

    Wednesday, September 09 2015, 09:37 AM - #permalink
    0
    Hi, What parameters are missing? See attached image.
    Please open: templates/shoplab/css/style.css

    Find line:
    .vmproduct.schover:hover .vmcartarea, .vmproduct.xschover:hover .vmcartarea {
    bottom: 0;
    }


    replace:
    .vmproduct.schover:hover .vmcartarea, .vmproduct.xschover:hover .vmcartarea {
    bottom: -100px;
    }
    Attachments:
    The reply is currently minimized Show
  • Accepted Answer

    Wednesday, September 09 2015, 12:10 PM - #permalink
    0
    Thank you for your response and help!
    I tried, what you suggested, it removed the button, but this solution is not good for me, because this way the "out of stock, notify me" button is also missing.

    I try to make my problem clear, maybe you can suggest an other solution also.
    I have 4 kinds of products:
    1.) Simple products, where only the "add to cart" function is needed.
    2.) Products, that are sometimes out of stock, so the "notify me" button is also needed.
    3.) Products, that have cart variants in custom fields (like the image you attached), where I really like this feature, that you can choose the variants and add to cart in category view also, it makes the process much easier.
    4.) I have one product, where I would like to force the user to go to product details page, instead of use add to cart in this view, because there is an important information in the description, and usually they don't read it, because they can order it without going to the product detail page.

    So, because of this only one product, I would like to disable or remove the possibility to add the product to cart in category view.
    I'm afraid that it can not be done with only one product (but if you can do it somehow, please let me know), so I would like to disable, or rename, or delete the add to cart button in category view, but without removing the notify me button.

    Do you have any suggestion?
    The reply is currently minimized Show
  • Accepted Answer

    Wednesday, September 09 2015, 11:28 PM - #permalink
    0
    Ok, Please open: templates/shoplab/html/com_virtuemart/sublayouts/addtocartbar.php

    Find:
    $addtoCartButton = '';
    if(!VmConfig::get('use_as_catalog', 0)){
    if(!$product->addToCartButton and $product->addToCartButton!==''){
    $addtoCartButton = shopFunctionsF::getAddToCartButton ($product->orderable);
    } else {
    $addtoCartButton = $product->addToCartButton;
    }

    }
    $position = 'addtocart';
    //if (!empty($product->customfieldsSorted[$position]) or !empty($addtoCartButton)) {


    if (!VmConfig::get('use_as_catalog', 0) ) { ?>
    <div class="vmcartbox">
    <?php
    // Display the quantity box
    $stockhandle = VmConfig::get ('stockhandle', 'none');
    if (($stockhandle == 'disableit' or $stockhandle == 'disableadd') and ($product->product_in_stock - $product->product_ordered) < 1) { ?>
    <a href="/<?php echo JRoute::_ ('index.php?option=com_virtuemart&view=productdetails&layout=notify&virtuemart_product_id=' . $product->virtuemart_product_id); ?>" class="notify"><?php echo vmText::_ ('COM_VIRTUEMART_CART_NOTIFY') ?></a><?php
    } else {
    $tmpPrice = (float) $product->prices['costPrice'];
    if (!( VmConfig::get('askprice', true) and empty($tmpPrice) ) ) { ?>
    <?php if ($product->orderable) { ?>
    <!-- <label for="quantity<?php echo $product->virtuemart_product_id; ?>" class="quantity_box"><?php echo vmText::_ ('COM_VIRTUEMART_CART_QUANTITY'); ?>: </label> -->
    <span class="quantity-box">
    <input type="text" class="quantity-input js-recalculate" name="quantity[]"
    onblur="Virtuemart.checkQuantity(this,<?php echo $step?>,'<?php echo vmText::_ ('COM_VIRTUEMART_WRONG_AMOUNT_ADDED')?>');"
    onclick="Virtuemart.checkQuantity(this,<?php echo $step?>,'<?php echo vmText::_ ('COM_VIRTUEMART_WRONG_AMOUNT_ADDED')?>');"
    onchange="Virtuemart.checkQuantity(this,<?php echo $step?>,'<?php echo vmText::_ ('COM_VIRTUEMART_WRONG_AMOUNT_ADDED')?>');"
    onsubmit="Virtuemart.checkQuantity(this,<?php echo $step?>,'<?php echo vmText::_ ('COM_VIRTUEMART_WRONG_AMOUNT_ADDED')?>');"
    value="<?php echo $init; ?>" init="<?php echo $init; ?>" step="<?php echo $step; ?>" <?php echo $maxOrder; ?> />
    </span>
    <span class="quantity-controls js-recalculate">
    <input type="button" class="quantity-controls quantity-plus"/>
    <input type="button" class="quantity-controls quantity-minus"/>
    </span>
    <?php }

    if(!empty($addtoCartButton)){
    ?><span class="addtocart-button">
    <?php echo $addtoCartButton ?>
    </span> <?php
    } ?>
    <input type="hidden" name="virtuemart_product_id[]" value="<?php echo $product->virtuemart_product_id ?>"/>
    <noscript><input type="hidden" name="task" value="add"/></noscript> <?php
    }
    } ?>
    </div>
    <?php
    } ?>


    Replace:

    $addtoCartButton = '';

    if(!VmConfig::get('use_as_catalog', 0) && ($product->virtuemart_product_id!='161' || $jinput->get('view')!='category')){
    if(!$product->addToCartButton and $product->addToCartButton!==''){
    $addtoCartButton = shopFunctionsF::getAddToCartButton ($product->orderable);
    } else {
    $addtoCartButton = $product->addToCartButton;
    }
    } else {
    // Product Details Button
    $link = empty($product->link)? $product->canonical:$product->link; echo JHtml::link($link.$ItemidStr,vmText::_ ( 'COM_VIRTUEMART_PRODUCT_DETAILS' ), array ('title' => $product->product_name, 'class' => 'product-details' ) );
    }
    $position = 'addtocart';
    if (!VmConfig::get('use_as_catalog', 0) and !empty($addtoCartButton)) { ?>
    <div class="vmcartbox">
    <?php
    // Display the quantity box
    $stockhandle = VmConfig::get ('stockhandle', 'none');
    if (($stockhandle == 'disableit' or $stockhandle == 'disableadd') and ($product->product_in_stock - $product->product_ordered) < 1) { ?>
    <a href="/<?php echo JRoute::_ ('index.php?option=com_virtuemart&view=productdetails&layout=notify&virtuemart_product_id=' . $product->virtuemart_product_id); ?>" class="notify"><?php echo vmText::_ ('COM_VIRTUEMART_CART_NOTIFY') ?></a><?php
    } else {
    $tmpPrice = (float) $product->prices['costPrice'];
    if (!( VmConfig::get('askprice', true) and empty($tmpPrice) ) ) { ?>
    <?php if ($product->orderable) { ?>
    <!-- <label for="quantity<?php echo $product->virtuemart_product_id; ?>" class="quantity_box"><?php echo vmText::_ ('COM_VIRTUEMART_CART_QUANTITY'); ?>: </label> -->
    <span class="quantity-box">
    <input type="text" class="quantity-input js-recalculate" name="quantity[]"
    onblur="Virtuemart.checkQuantity(this,<?php echo $step?>,'<?php echo vmText::_ ('COM_VIRTUEMART_WRONG_AMOUNT_ADDED')?>');"
    onclick="Virtuemart.checkQuantity(this,<?php echo $step?>,'<?php echo vmText::_ ('COM_VIRTUEMART_WRONG_AMOUNT_ADDED')?>');"
    onchange="Virtuemart.checkQuantity(this,<?php echo $step?>,'<?php echo vmText::_ ('COM_VIRTUEMART_WRONG_AMOUNT_ADDED')?>');"
    onsubmit="Virtuemart.checkQuantity(this,<?php echo $step?>,'<?php echo vmText::_ ('COM_VIRTUEMART_WRONG_AMOUNT_ADDED')?>');"
    value="<?php echo $init; ?>" init="<?php echo $init; ?>" step="<?php echo $step; ?>" <?php echo $maxOrder; ?> />
    </span>
    <span class="quantity-controls js-recalculate">
    <input type="button" class="quantity-controls quantity-plus"/>
    <input type="button" class="quantity-controls quantity-minus"/>
    </span>
    <?php }
    if(!empty($addtoCartButton)){
    ?><span class="addtocart-button">
    <?php echo $addtoCartButton ?>
    </span> <?php
    } ?>
    <input type="hidden" name="virtuemart_product_id[]" value="<?php echo $product->virtuemart_product_id ?>"/>
    <noscript><input type="hidden" name="task" value="add"/></noscript> <?php
    }
    } ?>
    </div>
    <?php
    } ?>


    Replace 161 to your product ID.
    The reply is currently minimized Show
Your Reply

VirtueMart Admin Theme

VMADMINLAB

Responsive VirtueMart 3 Administrator Template

Download
JOIN NOW!

New Joomla! 3 Template

REVOLAB

Responsive Joomla 3 Template / VirtueMart 3 Theme

Template Demo
JOIN NOW!

Recent Discussions

In all Download Folders from my Download Arrea are only the html and the images ...
3 days ago 4
Dobrý den, mám u Vás zakoupený proff. package, vytvořil jsem si šablonu, ale pok...
4 days ago 1
Hi I get the following warning on the product page when using the Simple File Up...
6 days ago 1
Password proctected content
2 weeks ago 2

Who's Online

We have 188 guests and 3 members online

Linelabox.com is not affiliated with or endorsed by Open Source Matters or the Joomla Project. Joomla!® name is used under a limited license from Open Source Matters in the United States and other countries.
Copyright © 2014 Linelabox.com - Joomla! 3 / VirtueMart 3 Templates. All Rights Reserved.
Joomla! is Free Software released under the GNU General Public License. All other marks are the property of their respective owners.
LINELAB WEBDESIGN