Magento Integration with a Simple Static Site

Magento is an incredibly powerful e-commerce platform. However, it is also very difficult, and I would like to know if there is a relatively simple way to use Magento as our mISV website backend to execute orders without actually “using” Magento's infrastructure to create the website, launch the website, etc. In other words, I do not want to use the embedded CMS, etc., since we have a static website already built. I would just like the Buy Now buttons to use the material for verification, and would like to be able to use the auxiliary part to track orders, etc. I was able to accomplish this “pretty” easily with osCommerce, but Magento is a little harder to wrap my head around since I just started looking at it for several days.

I found another person asking the exact same question about the Magento wiki (along with several others on the forum), and none of them ever received an answer for some reason. I noticed that there might be Magento stack overflow experts, so I thought I'd let him go here. This is an example of one question asked by someone on their wiki, and it reflects the essence of what I'm trying to accomplish:

Hi, as far as I understand, all the shopping cart / e-commerce solutions I see the full-featured web version of the PHP site. This means that all pages the user interacts with the server and, thus, the experience is tied to a magenta framework / workflow. I would like to combine bits and pieces of an E-commerce / shopping cart in my existing Web site. Effectively, I'd like to have:

1) on the product information page, the button "buy now / add to basket", which adds to the basket

2) On each page, cart / statement Option

3) on the verification page, with additional content already in place, having a magento "checkout" integrated into the page (and not the entire page generated by Magento).

Have any of you done this with Magento? This is for a simple single product website, so any advice you could share was greatly appreciated.

+7
e-commerce magento oscommerce shopping-cart
source share
2 answers

1) on the product information page, the button "buy now / add to basket", which adds to the basket

Perhaps this question will help you (look at the question, not the answer :-)), since it shows how to add an item to the cart by contacting a specific URL that will allow this outside of Magento.

2) On each page, cart / statement Option

Are you sure you want to show items in the basket or just have a link to the basket / order? The latter would be trivial, obviously.

3) on the verification page, with additional content already in place, having a magento "checkout" integrated into the pages (and not the whole page) created by Magento).

I think this should be possible, but it will require you to take a look at the insides of Magento. For this you need

  • include Magento JS and CSS files in your site

  • fake a request to send to Magento (by substituting the Magento bootstrap and entering your own instance of Mage_Core_Controller_Request_Http your fake Mage_Core_Controller_Request_Http URL)

  • capture the output of a fake request (which should be possible through ZF, if you cannot figure it out, you can still use ob_start, etc.)

  • print the html code on your own website

If you have experience with the Zend Framework, this should not be too difficult for you.

As for the rest, you don’t have to do much because the (one page) check is based on AJAX calls, which probably do not bother you with the actual site.

I can’t say whether it will be as simple as with osCommerce (not using it), but I am very sure that this is doable.

+2
source share

We use the static Magento back end interface (www.movingpicturebooks.com). This is pretty straight forward. The biggest problem is that you need to tightly bind your interface to specific product identifiers. If you work with separate development and production environments, it can be a real bitch to synchronize them. But this is another topic. Here are the snippets you need:

1) Add buttons to the cart . Use this link format:

/ statement / basket / add / product = $ PRODUCTID &? Qty = $ QUANTITY

2) Cart for communication : / checkout / cart /

3) Link to check : / checkout / onepage /

4) My account : / client / account /

5) Login / Logout . To access a Magento session you need to have a small PHP code, and then depending on where it is located, display the appropriate link. Example:

 <?php $include_file = $_SERVER['DOCUMENT_ROOT'] . '/app/Mage.php'; require_once ($include_file); Mage::app("default"); Mage::getSingleton("core/session", array("name" => "frontend")); if (empty($session)) { $session = Mage::getSingleton("customer/session"); } if($session->isLoggedIn()) { $login_action = "Sign Out"; $login_url = "/index.php/customer/account/logout/"; } else { $login_action = "Sign In"; $login_url = "/index.php/customer/account/login/"; } ?> 

6) Skinning . You mentioned the desire to embed Magento Shopping Cart material in your design template. This is not just a cart that you need to worry about - it is my account, login, password to forget, all kinds of things. This is one area of ​​Magento that is halfway documented. Do a little research and you can download it.

+5
source share

All Articles