October 2017
Intermediate to advanced
370 pages
8h 57m
English
To obtain the product_id, we'll make use of AMP's variable substitution functionality again (we saw this in Chapter 6, Making Contact Forms in AMP). This time, we use QUERY_PARAM(del). When the AMP runtime encounters this, it will substitute in the value of the del parameter from the URL, which happens to be the product_id that we want to remove from the cart.
Then we'll want to get this value to the server. To do this, we'll append it to the amp-list URL like this:
<amp-list src="/ch7/cart.php?client_id=CLIENT_ID(cart)&del=QUERY_PARAM(del)" ...>
All the work needed on the AMP side is done, so now we need to set up the server. If the del parameter is detected by the server, then any ...
Read now
Unlock full access