add to cart button invisible in virtuemart - joomla

I am using virtuemart 2.0.16, I am facing some problem related add to cart button,without login we can't show add to cart button. after login add to cart button display. but I want to display Add to Cart Button user is login or not.
Here is my link
Can anybody help me to solve this ?

First of all check the VM Configuration tab any setting related to this.
like the add to cart button only display for logged users or something like that.
If you can't find that.
components/com_virtuemart/view/productdetails/tmpl/default.php and default_addtocart.php
file in that may be checking user logged or not .
something like
if($user->id){
<button>add to cart</button>
}
the code is not exactly like above but it may help you.

you find that
components/com_virtuemart/views/productdetails/tmpl/default.php
find the addtocart button code then put
$user =& JFactory::getUser();
if($user->id){
// add to cart button code here
}else{
// your message here
}

Related

Shopify add to cart ajax update cart on button click - Update the cart note and the entire cart drawer

I am working on a shopify site where I have created a hover over option for quick shop. When the item is added to the cart I need the cart number to update and the cart drawer to update. However, this is not working! Can someone help?
You could use something like:
jQuery.getJSON('/cart.js', function(cart) {
$('#CartCount').text(cart.item_count)
});
Where #CartCount is your counter. For the dropdown cart itself, I believe you'd have to rebuild the cart yourself via the cart.js response.

Magento one page login not working

currently i am working with a magento shopping site.I am newbie to magento. When i tried to login via one page both login and create button are disabled.
Default login and create account working fine.I have added
<?php echo $this->getBlockHtml('formkey'); ?>
please help me to solve the problem.Thanks in advance.
please check this link
http://qwertykart.com/checkout/onepage/
Check your one page checkout setting if register is not enabled.
if there is no setting for this, then Install this Extension to see exact .phtml file, where you need to edit.
https://www.magentocommerce.com/magento-connect/easy-template-path-hints.html
After setup, you can get your template path by adding tp=1&code=1 in the url.
(You have to save code value in magento backend)
I see your Register button having "disabled"=disabled attribute. Try to remove that. After removing that you will be able to register.
Do it for other buttons as well.

Adding 'terms and conditions' to Infusionsoft shopping cart

I want to get SagePay on my company's Infusionsoft shop. But, SagePay ask for a checkbox on the checkout to confirm that customers have read the terms and conditions. Totally understandable - but Infusionsoft do not support this option by default.
I am not using the API. Does anyone know a way, perhaps with Javascript, that I could create such an option and NOT let customers proceed to checkout without clicking 'accept'?
Thanks in advance,
Nicole
You should be able to add an onclick listener for the checkout button using something like this:
document.getElementById("idOfButton").onclick = function(e) {
//Look at value of checkbox
//If checked, don't do anything
//else e.stopPropagation
}
In your shopping cart theme you should be able to paste in html for the checkbox.

Magento: Clicking on add to cart open a order form. After submitting form redirect to add to cart page

I am working on one magento site. What client need after clicking on Add To Cart button a prescription form will be opened.
After filling prescription form it redirect to Add to cart page. On Cart page product listing prescription that user added should be display with product.
Can anyone guide me how to achieve this?
1) Switch the addtocart url with a javascript pop-up that opens.
2) Do the addtocart using ajax.
3) Show form in pop-up
4) When filled in do ajax post to controller that saves the items to the quote-item (setData).
5) Redirect to cart when this succeeds
6) Display custom data in the renderer using getData.
I guess this flow will put you in the right direction?

Access virtuemart cart and shop for registered user only

Can i restrict the access permission for virtuemart cart and shop. It is my client requirement to show add to cart and user cart only for registered user and whenever any visitor try to get cart it will be redirected on login page.
have any possibility in virtuemart to fix access permission for non register user OR I should to change shop module code to restrict the access.
Need your suggestion very fast...
Thanks
As far as the cart is concerned, if you have it in a module then you simply need to set the access level to registered. For the cart flypage, you will need to set up a menu item for that page and set the access level to registered. The menu item can be in a hidden menu, it does not have to be displayed anywhere for this to work. As far as the add to cart button, You just need to make a modification to the theme, look for addtocart_form.tpl.php. You can put a simple conditional statement that displays a message if the user is not logged in. Here is a good example of using the user object in Joomla -
http://docs.joomla.org/Accessing_the_current_user_object
You could easily copy the example on this page for the add to cart form.

Resources