HTTP URL Re-writing Modifier - jmeter

When I recorded my requests I add product in cart, I got this path when click on the button Add to cart
/checkout/cart/add/uenc/aHR0cHM6Ly93d3cuZ2xvc2tpbmJlYXV0eS5jb20vZGFpbHktcG93ZXItYy1wbHVz/product/9491/
In code script on-page, I find %25uenc%2, it's dynamic value is generated every time when I add a product to cart. This parameter doesn't display in parameters will the request. How I need to write Pre or Postprocessor to get this value?
/checkout\/cart\/add\/uenc\/%25uenc%25\/product\/9491\/","data":
"url":"https://********/checkout/cart/add/uenc/%25uenc%25/product/9491/"

Related

How to get current variation price in woocommerce single product page using ajax?

On Single product page of a variable product of woocommerce when user selects product options; woocommerce makes an ajax call and shows the variation price and inventory available. I just need to know how can I add my custom math to that ajax response? For example current variation price ajax response was 300 I want to add 30 more to that. Can anybody help plz?
I searched woocommerce files but no luck.

Magento Add to Compare URL inconsistency for the same product

I have a
(1) Magento home page which I've customized to display "New Products", with Add to Compare button.
(2) The pretty standard product listing pages which display based on user filters. Add to compare button is also displayed here.
Both page templates call on getAddToCompareUrl for their respective products. But for some reason the Add to Compare URL generated on the homepage is different/ missing a chunk and clicking on it does not result in the product getting added to the Compare List. The Add to Compare URL that is generated for the Product listing, however, works just as expected. Here are the "Add to Compare" URLs being generated:
Home Page (Add to compare URL does not work and looks incomplete as compared to the one generated on product listing)
http://localhost/mg1/index.php/catalog/product_compare/add/product/156/uenc/aHR0cDovL2xvY2FsaG9zdC9tZzEvaW5kZXgucGhwLw,,/form_key/ysxqFftqrKpaqGqE/
Product Listing (Add to compare URL works)
http://localhost/mg1/index.php/catalog/product_compare/add/product/156/uenc/aHR0cDovL2xvY2FsaG9zdC9tZzEvaW5kZXgucGhwL2xhcmdlLWFwcGxpYW5jZXMvcmVmcmlnZXJhdG9ycy5odG1sP21hbnVmYWN0dXJlcj0yMg,,/form_key/Vh0H6NDCl3wFGSys/
If i observe the differences between both URLs, it seens the URL generated on the homepage is missing a huge chunk in the /enc/ section, the /form_key/ is also different on both URLs, although they are for the same product (ID 156).
I had a quick look at the getAddToCompareUrl function where i see it deriving the url enc and form key portions of the URL, (code\core\Mage\Catalog\Block\Product\Abstract.php) but without knowing how to debug through the myriad of class calls underneath it, I'm lost.
Help anyone?

Can an image be added to each item in a PayPal Cart?

I am using a simple cart with an "Add to Cart" button. I would like to add an image along with the description of each item placed in the PayPal cart. I have tried placing an image url in the value field of the variable item_number. But nothing I trying seems to fool PayPal and I can not find a PayPal variable that allows the insertion of a item image.
Anybody have any ideas or suggestions?
Here is part of the code that I used in the Add to Cart Button code:

Apply Custom Option via Ajax to a product

Has anyone had any success in Applying a custom option to the product object via Ajax.
ie. A ajax request will get triggered when ever I select a custom option which changes the product price.
I have a ajax Block in the Product View page that depends on the Product Price. Since Magento Applies the Custom Options after the product is added to the cart , I am finding it difficult to render the ajax block with my updated product price.
Any idea's ?
Try this module, its good ajax cart and it has exactly what you need and you can customize it easily
https://github.com/hws47a/VF_AjaxCart

Magento Cart: Check for items empties cart

I am new to Magento, but I thought I had a grasp on it until today. Here is my problem.
I am writing a new Observer to add a coupon to the cart on page load. The coupon code is passed in the URL and I desire the code to be passable through ANY working URL.
For example: http://magento/?coupon=MYCOUPON
I am catching on the event "controller_front_init_routers" to capture the coupon code.
I have the observer working, but if I already have an item in the cart and I pass a coupon code my cart appears empty, here is how I am adding the coupon:
public function applyCoupon($observer){
$coupon_code = $observer->getEvent()->getData('front')->getRequest()->getParam('coupon');
if(!empty($coupon_code)){
Mage::getSingleton('checkout/session')->setData('coupon_code', $coupon_code);
Mage::getSingleton('checkout/cart')->getQuote()->setCouponCode($coupon_code)->save();
Mage::log('Coupon Code: '. $coupon_code);
}
}
It seems that anytime I call Mage::getSingleton('checkout/session')->anything() I lose the session for the cart.
I thought maybe I simply needed to fetch the current cart ID and load it, but I can't seem to find a way to do that either.
Has any one had experience in this, maybe has a solution?
The problem is in event, that you are observing. Because Magento session wasn't initialized at that moment, so cookie has different name, than core one.
Use controller_action_predispatch for setting up some session data from request.

Resources