Magento Hooks - Will Magento allow me to do this? - magento

I'm going to be starting a E-Commerce project and the client is interested in using Magento. In this project, when a customer adds something to the cart, I'll need to pull them out of the flow, where they'll proceed through a custom wizard-esque area.
They basically design a document using a drag and drop interface. After they finish, that document will be saved as a PDF, and I want them redirected to checkout
So my questions are
Does Magento have hooks available for after an item is added to the
cart ?
If I pull them away to this other section of the site (Wizard
portion), changes they make will potentially add costs to
their cart. Would I still have access to products, prices, and the
cart so that I can continue to modify their cart until they return
to checkout ?

Magento users Event-Observer pattern, where you can hook into virtually any action which is performed and execute your custom code,
Refer to below links,
http://inchoo.net/category/ecommerce/magento/events-observers/
https://gist.github.com/peterjaap/6973324
http://huztechbuzz.wordpress.com/2014/04/26/complete-list-of-all-events-in-magento/
http://www.nicksays.co.uk/magento-events-cheat-sheet-1-7/
So you have to figure out which event you can use and plugin your custom code.

As long as i remember all the cart info ( products/prices ) is stored in the $_SESSION. So you can get all the information from there you need, modify it via your so-called wizzard and udpate the session information after that!
Cheers! :)

Related

Magento 2 - Transfer cart items from API to web store

I am creating a complex shopping configurator app that allows a user to customize and visualize a product which consists of multiple store items. Once they confirm their purchase, I iterate and add all of the selected products to a guest cart using the .../rest/V1/guest-carts API endpoint.
I would now like to forward the user to the store checkout to continue the purchasing process from the web store, e.g. https://store.url/checkout/cart. Of course, that basket needs to be populated with the items that were added via the API. I've looked through the documentation but not been able to find
anything relevant but I wonder if I can pass over the store_id or the quote_id and the relevant products be inserted accordingly?
Not sure if this is still relevant for you but, I was also working on a similar problem and came across this plugin for Magento 2. Basically what this plugin does is use a customer's token and a quote_id and creates a temporary session on the Magento2 Store and then redirect the user to the checkout page. This was a starting point for me, as I had to customize this plugin further to suit my requirements.
Hope this helps.

Different checkout pages based on product category in Magento

I am new to Magento .So please forgive me if I am asking something silly.
I am working on a Magento shop where I have a requirement that when I select some product in certain category say X, then I am redirected to one page checkout where I have default shipping method and do not want any payment method. i.e. Skip shipping and payment method step in chekout.
Whereas if I click some other categories then I get redirected to onepage checkout with shipping and payment option.
So basically what I need in form of code is -
if(category==X)
then Checkout without Shipping and payment method
else
Checkout with Shipping and Payment options.
As far as I have explored the magento structure , it is far too complex then other CMS. I am not able to even find files where i have to make changes in code. Anybody out there who can guide me for right approach toward the solution? Or is there any extension which fulfills such requirement?
Thanks in advance.
First, create the new payment method for the category (and shipping method if you need that too).
http://www.magentocommerce.com/wiki/5_-_modules_and_development/payment/create-payment-method-module
http://www.magentocommerce.com/wiki/5_-_modules_and_development/shipping/create-shipping-method-module
Then I would probably extend the controller, though you probably could also use an observer.
Extend magento core controller (Checkout/OnepageController)
Keep in mind that the customer may have products from another category in their cart, and what to do in that case.

Can Magento be used as a CMS to build a product catalog(not a store currently but maybe in the future)

I have to build a website for a mobile store. They want to list their products but don't want to start selling yet. I have done a lot of website with Joomla and Virtuemart.
This time I want to use Magento as they use Lightspeed a POS that offers integration with Magento community edition.
My question is can I simply use Magento as a CMS to only display products and a few static pages like about us etc. I went through stackoverflow and found that some members have recommended some good blog integrations for magento so that part is solved(Thanks :-) ).
I know I can use wordpress as a blog with magento.
I rephrase....Can I use it to simply display products!
If Yes then please let me know if I am doing it for the right reason.
the reason are:
Adding products and product information becomes very easy in a
shopping cart(But in a CMS like Joomla each page has to be literally "designed" or I will have to use CCK editor. It still
becomes difficult for the client to update products IMO)
It comes with built in plugins to show related/featured products
etc. with a click on a button or options in the backend while client
simply puts the appropriate tags(With a CMS have to use a plugin or
module in Joomla that has to be set to show in the particular pages)
Automatic display of images etc is easier in Magento in comparison
to a CMS like Joomla where I will have to use a plugin or a gallery
that is set to show inside an article
The buy/add to cart button can easily be disabled and a "more info"
button can be added that will send an email to the client. They get
the exact product code the customer is asking for(Doing that in
Joomla would require a lot of extra stuff like adding codes or use
an advanced contact form with a tag to be entered for each page)
Last but not the least when client is ready to go online it can
easily be converted
Does Magento have two display? One is simply a catalog and the other a store. I have seen that in some stores online(not necessarily using magento) I am assuming either they created a website with the products pages first and then added a store later.
But in many cases it looks like a part of the Shopping application.(i just can't seem to remember which one they were using now).
If Magento allows that then I think my problem is solved. I simply use the "catalog option" and when the client is ready for the store I simply pull the products using a extension from their POS software.
Thank you for taking the time to read/answer.
Using Magento as a catalog only without selling the items is pretty straightforward. The easiest thing to do is just to use the catalog category lists to list the products and just make sure the "order" button is not visible.
You can do this simply by removing it from the product detail template (and the list/grid template in case they have it).
Or you could (I think) set all products to 'out of stock' this will automatically remove the 'order' button.
If you want to be thorough you should edit the cartControllers's addAction to disable adding products to the cart.
If you are going to combine Magento with Wordpress, Fishpig has developed a plugin with which you can use shortcode within Wordpress blogposts or/and pages to display products.
More info about that can be found here: http://fishpig.co.uk/wordpress-integration/docs/shortcodes.html
System > Configuration > Advanced > Advanced
Disable the modules you don't want to use.
For example, if you wanted to use Magento as catalog only then disable sales module.
Hope this works for you!

Magento: adding product from frontend form

I have magento demo shop and for example i want registered user to be available to post a product from frontend? Can anyone hook me up with some code showing how to make it? Is it even possible in magento?
It's certainly possible. It actually shouldn't be all that difficult. You're going to create a module, programmatically create an order, and link this page from somewhere. You should be able to hack one together with the following resources:
Programmatically Creating Orders - Inchoo
Creating a Custom Module part 1-8
yes dear it is possible, you have to create a module for that and i think you give to link/tab in customer account page in front side.in account page you provide form of add new product.you have also provide all option like in magento back end. but some customization are required

How do I create a Magento module or widget that will appear on the shopping cart page?

I’m having a lot of trouble understanding how to create a module that will add an extra button to the shopping cart page. I found lots of info on payment modules and stand-a-lone page modules, but nothing for this.
I simply need to add a button underneath the regular “Checkout” button that can post item data to another website. I’ve created a module but can’t get Magento to recognize it and display the button on that spot. Any help would be greatly appreciated, even just sending me to an existing tutorial that I haven’t been able to find. Thanks.
A custom module is probably overkill for this. Module means a very specific thing in Magento. It's a mechanism for inserting custom code into Magento's standard operations. All you want to do is add a button to the cart page. Editing the file at
./base/default/template/checkout/cart.phtml
(substitute your theme/site name if not using base or default)
is the place you'll want to start looking. Just find the phtml file that corresponds to the place you want to insert your custom HTML and have at it.

Resources