How to find a Guest user cart details? - magento

I want to get the Guest user cart details in magento.
Suppose a user comes to Magento site and add a product to cart.Then again come to same product and again he wants to add the product to cart.Now I want to check if the same guest user has already that product in the cart.
I am using following to get the guest user details$session=Mage::getModel('core/session');
using above code If I use print_r(session) then I get a visitor Id.
How Can I load the check out cart collection using this visitor ID to check If he already have that product in the cart.

To get the items stored in the cart you can use:
Mage::getSingleton('checkout/session')->getCart()->getItems()
Then you can loop over all the items and check wether the id is already there.

Related

I Can not view category without login

Nice to meet you all, sorry my english is bad.
I just wanna ask this question:
How to view product without login in Prestashop 1.7 ?
I try to click a category on my prestashop website without account login, but i can not view any products. Message is "You don't have acces to this category"
It looks like your categories access is limited by groups.
Go to Catalog->Categories, edit the required categories and select checkboxes with your customer groups. Save changes.
Check the screenshot:
http://prntscr.com/otwshc

Magento drop down to be selected by buyer

I am new to Magento. The website I am working on sells contact lenses and some custom attributes need to be added on the product page. Now requirement states that user has to select some prescription values from drop-down fields before adding the product to cart. I am totally lost on how to do it. This question asks the same thing:
Fields to be filled by the buyer in magento product page
But the answer points to dead link. How to retrieve some custom information from user on product page and store it along with order?
This is possible with custom option. Magento provide custom option facility. when you create custom option then it displayed on product page and you will get information from customer and that information stored in order automatically.
reference link : https://www.youtube.com/watch?v=wfZCXjWqrSM
You can create Dynamic custom option. I have answered thw whole process here:
dynamically add product custom options magento
As the Custom option applicaple to particular category. so you need to add required conditionon on precription form on product detail page.
You can manage this using custom option and there is a great module available in magento connect to achieve your goal.
http://www.magentocommerce.com/magento-connect/custom-option-manger.html

Magento: Disable products being added to multiple categories

Is it possible to disable users from adding products to multiple categories in the catalog? When a user tries to add a product, it shows all the available categories and sub categories
in the catalog and if the user selects all of them, the same product will be added all over the place in the store. I was wondering if there's a way to restrict that.
There's no way to do what you describe natively in Magento, you would have to write a local module.

Magento: Create order in backend and have customer complete payment

I'm exploring implementation options in Magento and am wondering if anyone has attempted or found a solution to this scenario...
I would like to be able to setup an order via the Magento backend (add products, set shipping price, etc) then have the customer be able to complete the order by logging into their account and proceeding through the checkout process.
Would be really great if the customer could get an email notification with a link directly to the payment step/checkout.
Is there a public extension that does this or something similar? Is the only option to push the products to a customer's cart then manually notify? Any other approaches on this?
Two possible ways of accomplishing this (assuming that all product are enable in that store)
In Admin create new order for that customer and add all items to quote, then under 'Items Ordered -> Action' click 'Move to Shopping Cart' (items will disappear from quote and should appear in the customer shopping cart once log in)
Create a custom quotation module (or modify new order creation) that email the customer with a link that will restore the quote on so the customer can complete the transaction
The Cart2Quote extension provides exactly that functionality.

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