Hi all
I'm having problems in getting cart link to redirect. This is one of my links:
cart/add/e-p2104_q1?destination=cart/checkout
It adds the product to the cart, but there's no redirect to checkout (also tried destination=cart to redirect to cart)
I don't see any other people here complaining about it, so I guess the problem could be on my side or my Drupal installation.
Any ideas?
Cart link redirect
Okay it seems like the reason the redirect is not working is because the link is coming from a form. This is the code I'm using:
<form method="LINK" action="/cart/add/p12_q1-m0?destination=cart" class="cartButton">
<input type="submit" value="Add to cart">
</form>I'm looking for a workaround. All I need is an html button as a link.
Hi,
I am new to ubercart. I need to add product in cart page and i need more than one add to cart buttons.
I have four sizes of product with different prices. when i am clicking the size
button product will be added to cart page.
I used this code:
I don't know what i have to give instead of this "p12_q1-m0" and what it means?
Please explain me as soon as possible.
Thanks in advance
I was using the following link on my site perhaps 2 weeks ago and it worked then:
https://thecfaa.com/cart/add/p128_q1-ibronze_membership?destination=cart/checkout
It worked beautifully by adding the Bronze One (1) Year Membership to the cart and redirecting the user straight to the checkout page. To see the original page, go to https://thecfaa.com/node/164.
We have switched to four memberships consisting of one (1) and three (3) year for both Personal and Business. Now I am in the process of switching completely away from the cart by giving users two pages to choose their membership and sign up:
Page 1: Membership Application (https://thecfaa.com/node/380)--> the potential member clicks the "I Agree" button, and is redirected to the next page
Page 2: Membership Options (https://thecfaa.com/node/378) --> the potential member clicks their desired membership type, and the cart is suppose to add that membership "product" to their cart and redirect them straight to the checkout page (bypassing the cart).
For example, the code for the Personal One (1) Year is
https://thecfaa.com/cart/add/p128_q1-ipersonal_one_year_membership?destination=cart/checkout
The products are added successfully to the cart, however, the user is redirected to the home page. I have tried this both as an anonymous user, and as a logged in user. To check the checkout page, go to https://thecfaa.com/cart/checkout
If someone could PLEASE give me some direction in this, I would be greatly appreciated! In fact, it's for my job, so I'm sure my wife would be glad you helped me also, lol.
I think the issue is the slash. You might try URL-encoding it. Try: cart%2Fcheckout
Also, just FYI, how are your Cart Links being created? You should use the l() function. The fourth parameter in the l() function is the query (anything after a "?" sign). So yours would be..
<?php
print l('Buy Now', 'cart/add/p128_q1-ipersonal_one_year', NULL, 'destination=cart/checkout');
?>For more check out the API page: http://api.drupal.org/api/function/l/5
You can also have other parts of the cart link created automatically by using info from the node, such as $node->nid (for the one they are buying). Hope this helps.
Thanks for the help torgos. I apologize for not seeing your reply sooner.
I have been using UC Add to Cart Tweaks for a few months, and now I'm having a problem again. We are adding a new product to our site, and therefore I have to redo our checkout process. I have been close to perfecting it, but no such luck. I have built a webform and I want the redirect to send the user to a cart link redirect url upon submission based on the option they choose in "Membership Options. I have the redirect adding the product correctly, but it still sends me to the frontpage. I will post the webform temporarily for anyone to look at and try to fix this...I have seen others who seem to have a similar issue.
Go to this link to see what I mean: http://www.thecfaa.com/node/20
The Membership Options are as follows:
https://www.thecfaa.com/cart/add/e-p130_q3?destination=cart%2Fcheckout|Personal - 3 years: $27
https://www.thecfaa.com/cart/add/e-p128_q3?destination=cart%2Fcheckout|Personal - 1 year: $10
https://www.thecfaa.com/cart/add/e-p377_q3?destination=cart%2Fcheckout|Business - 3 years: $65
https://www.thecfaa.com/cart/add/e-p131_q3?destination=cart%2Fcheckout|Business - 1 year: $25
As I said, the links work, i.e. the form is submitted correctly and the product(s) are added, however the redirect goes to the frontpage everytime. I'm REALLY frustrated...
Thanks to any and all who can help...
Well if it's a form, you can use $form['#redirect'] to force what page it will end up at.
To be honest I would probably, instead of using a webform that redirects to a Cart link, use a module to create a form which includes all the elements you need, and upon submission, uses uc_cart_add_item($nid) to loop through the options and add them to the cart... if that's a doable solution for you.



I can't reproduce this. Are you on D5 or D6? Do you have any restrictions set at admin/store/settings/cart_links?
Help directly fund development: Donate via PayPal!