AMP pages server by Google on checkout - php

I have a big problem with product amp pages when the page is served by google cache.
The user can add the product to the basket with a call like this:
action-xhr="https://sample.com/index.php?route=checkout/cart/add".
The backend is Opencart(php), and the product added to cart, no problem, but when the user go to checkout page (no AMP page, and not served by Google cache) there are no products on the shopping cart.
I guess it will be because when the article is added it is in a domain (google) and the payment page is in another domain, mine.
Is there any way to fix this?
I don't understand that google wants to provide a better user experience, and makes it so difficult to create a simple product page

Sorry you're hitting problems.
Here is the most relevant guide for your situation. In short, you want to transfer some kind of identifier from the AMP version of the page to your backend, and use that to sync the user state.
Without more information on your seutp, it is hard to get more specific.
source: work at Google on AMP

Are you looking for a way to make sure the user's cart is retained, whether they try to add to cart on an AMP cache or on your origin?
If so, there's a nice way described in detail here:
https://blog.amp.dev/2020/06/16/amp-camp-cross-origin-user-state-in-amp/

Related

Google Analytic tracking individual page on User Flow

I am having an OpenCart website and I already had Google tracking already. Page views/session tracking runs well without problem. However when I come to "User FLow" from "Behavior" tab in Google Analytic menu, I can only see sessions/views of only /index.php page, not for other pages. What if I want to see how many sessions/pageviews on other specific pages (contact page / product A / product B page?
For example, I have a page which have a link like this: http://..../onlinestore/index.php?route=product/category&path=120
I want to track how many users come to this page or even how many users click on the link which leads to this page, either is ok.
Since Opencart using mvc and routing mechanism or something like that, i cannot track using normal way. I have another html website which I can track specific page easilly by having the tracking code on each individual page. But not on this php page.
Thank you very much.

Completely custom Magento interface without shop

I have been searching but have not found much information on this. Would it be possible to completely override Magento's frontend interface? What I mean with this is completely remove the shopping cart, menu's, product listings, everything, and replace with a completely customized interface, which will not be used for a eCommerce portal.
I just found out that our customer does not in fact want a eCommerce solution, although we have built a lot of functionality on Magento and it would be a shame to have to re-write EVERYTHING on another platform and still build a ordering framework as well.
So my question is this, can you build a theme on Magento that only shows parts of the system completely unrelated to the actual 'shop' and where would I find information to figure out how to do this? I'd like to keep the custom frontend in Magento to easily re-use the product view blocks, etc. but Magento itself is not a system our client wants.
I have thought of an alternative where the Magento shop is merely placed in a sub-directory and used as a sort of 'engine' to run the eCommerce side of the system and building a completely different system which integrates with Magento, the downside of this of course being that we would have to rewrite completed work as well.
What would be the best route to follow?
Here is one way to go about it:
Edit the homepage via the backend and enter the following code in to it:
{{block type="catalog/product" template="page/homepage.phtml"}} this will allow you to display products on the page.
Make sure that when you enter the code you can see html markup (and not just the output)
Make a completely customized webpage showing whatever you want

Disable One-Page Checkout in OpenCart

How can I disable OnePage Checkout in OpenCart?
Version 1.5.x comes with it in the default template and I would rather not use it as we want to have step by step pages and not use Ajax (speed/page views and process serves our needs better) for our customers.
It is possible to remove the one-page setup, but you'll have to do a very good work on the template (the checkout folder contains all steps). You will need personalized controllers as well. The built-in checkout page uses jQuery and Ajax to gathering all the information necessary in only one page, to send everything together when the customer clicks "confirm".
Once you don't want to use ajax, you will have to send the information from one page to the next using post requests, putting then in hidden <input>'s and/or in $_SESSION variable. Anyway, you will have some problems with the countries and locations, since OpenCart retrieves then via ajax.
Actually, some time ago I've found some templates on ThemeForest and other sites that implemented what you want, but I don't know if they are available anymore.
I would actually recommend you use something like Uber Checkout which while its still a short checkout process, is better visually as you don't have the panels that are standard in 1.5.X. If you're wanting to completely rewrite it to work like the old checkout system, well in theory it's already there, you just need to rewrite the controllers for the various steps to output full pages rather than JSON and put in validations through each step to make sure previous steps have been completed

Magento require a user to accept t&c's before they can access the site

I've been asked to add a lightbox popup to a Magento site. It should appear the first time a user looks at the site so they have to check it before they can view the site or make a purchase.
If this isn't possible a JS popup or at the least just have the lightbox popup that needs to be clicked to dismiss it (but still allowing site access).
I've googled and looked on here, but everything seems to be related to the t&cs on the checkout page which isn't appropriate.
I'd appreciate any guidance or suggestions how to go about this.
Perhaps consider the AITOC Splash Page extension. It provides exactly the capability you're describing and seems to work well. I haven't used it on a CE site, only on a Magento Pro 1.11.1.0 site. Their extension though is available for CE and EE as well.
Use cookies—perhaps this library may help—save confirmation of T&C approval, and check on page load to detect whether user has confirmed.
Use some form of lightbox to display your message and approval mechanism.
Any more exact detail would make anyone expect payment! :)

How can I do Magento one page checkout (together with the UI) using API calls?

I want to implement one page checkout part of Magento from the outside of Magento structure (i.e. using API calls). If it is possible, I want to start using the existing code to reduce the implementation effort. So, how can I modify the existing checkout implementation in order to make it run from outside? Or, is there any other implementation which provides Magento checkout functionality together with the UI?
I'm not entirely sure what it is your after but if you're thinking of using Magento checkout say in Wordpress then you could simply include app/Mage.php and use pretty much all the functionality provided by Magento.
Say create a product (you would need one to check out) on the fly if it isn't already in Magento or render any templates - checkout in your case.
Not a problem to insert "add to cart" buttons to any website and use AJAX to request cart contents to the same page.
Also I just needed to code pretty much the same thing for OneStepCheckout which opens up in lightbox and allows you to check out from pretty much anywhere. HTML onepager for example or from Facebook:P

Categories