how to add additioanla parameter in referral URL in Magento - magento

I want to add additional parameter in referral URL. in Magento when I add item to compare list, it successfully added and then it redirect to referral URL. while going back to referral URL i want to add some additional parameters in the URL.
$this->_redirectReferer(); if i call the function it redirects the previous page. for example it redirects to http://magento.com/product.html
instead of this i want to redirect to http://magento.com/product.phtml/?timestamp
basically i want to add some additional parameter in my referral URL.

Related

How do I populate data in intercom custom attributes from segment?

Segment offers page method call, where you can track the previous URL of a visitor prior to coming on your website.
I have this referrer URL with me, I want to push this referrer URL to intercom.
What I really want to do?
Whenever a user signs up on our software, I want to track his previous URL and make it available in intercom under his profile.
Also, the custom attribute created in intercom by me is not working since I don't know what code I should write in my intercom code snippet.
Please refer screenshots.
Intercom
Segment
Intercom by default saves the Referral URL of the user in a field called Referral url.
Else if you want to manually push referrer URL as a custom attribute you can send the parameter in the following way:
Intercom('boot', {
app_id: '<<Your App ID>>',
referrer:document.referrer, //custom attribute id which you have created in intercom
});

Wicket Submit BehaviorListener after RestartResponseExeption and Session replacement

I have a AjaxFallbackLink to add a product into the wishlist of a customer. When a guest clicks the Link he is redirected to the login page with a RestartResponseAtInterceptPage. After successful login he returned to the first Page. But the URL contains the IBehaviorListener of my "add to wishlist" Link and every Ajax Link does nothing except to reload the page with no changes. I think the problem is the incorrect match of Page instance and BehaviorListener instance because my Page started with instance 1 and returned with instance 4 from Login Page. Everything works when the guest is already logged in.
How can i remove the illegal URL parameter or call the right Link callback to add the product to wishlist after successful login?
I think you need to do the following, in YourApplication#init() add:
getPageSettings().setCallListenerInterfaceAfterExpiry(true)
You can override it per Page if you don't want to enable it globally, see org.apache.wicket.Component#canCallListenerInterfaceAfterExpiry()

wordpress: how to force a form fill before going to a page?

I am building a wordpress site with this requirement: when the user attempts to navigate to certain pages, they will be forced to fill out a small form (enter their email address) before they can get to the desired page.
On a standalone site, I'd do it like this: on each "protected" page, I'd look for a cookie named "email". If this cookie doesn't exist, redirect to an email capture page, along with a url parameter indicating the page to go to after they enter their email. The email form would call a PHP script that would set the "email" cookie, then redirect to the desired page
How to do this in wordpress? Would I create my cookie testing code in a template and assign that to the protected pages?
Create a template and page for your php code and when user try to navigate to protected pages check for cookie if doesnt exist go to email page (instead it would be fine if the form appears in a pop up window).There when you get the email onsubmit use ajax to go create cookie from php page and once the cookie is set the navigation should take place .you should create a template for the php page ,and give the page id in ajax code
I hope this is what u r looking for.

Magento - How to create a custom url based on attributes?

In the Magento Admin > Catalogue > Attributes > Attribute Sets, we have a set of attributes for "Manufacturers" which group products under designers.
I am trying to create a hyperlink that maps a custom route to an attribute query like so
this is route i want:
{{base_url}}/designers/some-designer-name/
this is what it will map to:
{{base_url}}/?designer=136
I have tried creating a custom url rewrite under Catalogue > URL Rewrite Management with no luck.
Please refer this this may help you
http://www.atwix.com/magento/products-list-cms/
if you want to create custom url, than follow the steps...
From the Admin panel, select Catalog >> URL Rewrite Management
In the upper-right corner, click the Add URL Rewrite button
In the Add New URL Rewrite section, set Create URL Rewrite to “for Product.”
Find the product in the list below and click to open the record and click Skip Category Selection button
In the URL Rewrite section, do some following things:
a.In the Request Path field, enter the new value for the updated URL. The Request Path must be unique for each rewrite.
b.Set Redirect to one of the following:
Temporary (302)
Permanent (301)
For your own reference, enter a brief description of the rewrite.
click to save and enjoy ;)

Magento delete item from cart redirection on custom controller

Got a problem with redirection when remove item from cart on custom controller. I am writing a module that uses it's own route. When I delete item on magento pages like product page, catalog, etc. redirection works fine, it give me same page. But when I delete item on my custom module route, it redirects me on home page.
I found redirect function in CartController.php
$this->_redirectReferer(Mage::getUrl('*/*'));
Magentowiki says that '*' will use current module, controller or action in use.
Should I register my route somewhere else (besides config.xml of my module), so redirect function could understand it? Or maybe i have to use some event observer, check if current page is my module and then use my own redirect?
Try this:
$this->getResponse()->setRedirect(Mage::getUrl('*/*/*',array('_current'=>true)));

Resources