[solved] 'add to cart' as a link
[solved] 'add to cart' as a link
I would like to have the 'add to cart' show as a link !
like:
+ Add to cart
when click on this ... 1 piece is added to the cart
I already looked into the code, probaly i need to put the original 'add to cart' code in my template, let it hide and with the link simulate the submit button ...
But how can i do it ?
anyone kwows how or has an idea ?
Kind regards
Peter
like:
+ Add to cart
when click on this ... 1 piece is added to the cart
I already looked into the code, probaly i need to put the original 'add to cart' code in my template, let it hide and with the link simulate the submit button ...
But how can i do it ?
anyone kwows how or has an idea ?
Kind regards
Peter
Last edited by pedes on Mon Sep 20, 2010 2:13 pm, edited 1 time in total.
Re: 'add to cart' as a link
anyone ever tried this ?
any suggestion would be welcome.
Thank you very much.
Kind regards,
Peter
any suggestion would be welcome.
Thank you very much.
Kind regards,
Peter
Re: 'add to cart' as a link
pedes,
Please let us know which ecommerce suite you are addressing this question to.
Duketown
PS. In module Cart Made Simple you would change the template that shows the products.
Please let us know which ecommerce suite you are addressing this question to.
Duketown
PS. In module Cart Made Simple you would change the template that shows the products.
Re: 'add to cart' as a link
Your right forgot to say that i'm using the cgecommerce suite
so i would like to make a 'add to cart' link for the cartmodule
in the cgecommerce suite
thx for any suggestion
kind regards
peter
so i would like to make a 'add to cart' link for the cartmodule
in the cgecommerce suite
thx for any suggestion
kind regards
peter
Re: 'add to cart' as a link
Hi, I'm struggling with cart module as well This is little hack, I just figured out, but I'm not sure if it work. Just try it:
In Cart admin make addtocart template called "add_to_cart_init" and leave it totally blank.
In your page put:
{Cart action='default' addtocarttemplate='add_to_cart_init'}
//page=... replace with page alias, where you want to be redirected after sending the form
//here, again put id of page, where you will be redirected after
//and again
// id of product, you wan to add, you can use smarty vars of course, like $entry->id if you are in Products detail etc.
Submit //here is your submit link
And of course, strip my comments
I'm not sure about this, but probably, when you set in Cart admin, default page to redirect after submitting, I think, that all these page parameters, which i use in this template are ignored...
Hope It will work, I will try it when I will have little time...
In Cart admin make addtocart template called "add_to_cart_init" and leave it totally blank.
In your page put:
{Cart action='default' addtocarttemplate='add_to_cart_init'}
//page=... replace with page alias, where you want to be redirected after sending the form
//here, again put id of page, where you will be redirected after
//and again
// id of product, you wan to add, you can use smarty vars of course, like $entry->id if you are in Products detail etc.
Submit //here is your submit link
And of course, strip my comments
I'm not sure about this, but probably, when you set in Cart admin, default page to redirect after submitting, I think, that all these page parameters, which i use in this template are ignored...
Hope It will work, I will try it when I will have little time...
Re: 'add to cart' as a link
hi lapak,
thank you for your reply ... your solution did not work ... but you came a long way
i would like to thank you because with your starting point i managed a solution
here is what i did to have a link that will add 1 item of a product in the cart
(in the attached pic you see a the summary of products, 'kopen' is dutch for buying ... so thats the add-to-cart link)
first i made some css to style the add-to-cart link, because this is still a button but it looks like a link, in my form i gave the input type submit a class="addtobaglink".
then i made an UDT for retrieve my url and i called it {my_url}
I let it empty because i use the cart-preference "opening-page after add-to-cart" in the cart admin tab. but you can also put there the id of the page you want to be redirect after the add-to-cart-link is pushed.
But either it is empty and you use the cart admin preference or you put there the page-id to redirect to and set the admin cart preference to none.
Hope this will help some people
Kind regards
Peter
thank you for your reply ... your solution did not work ... but you came a long way
i would like to thank you because with your starting point i managed a solution
here is what i did to have a link that will add 1 item of a product in the cart
(in the attached pic you see a the summary of products, 'kopen' is dutch for buying ... so thats the add-to-cart link)
first i made some css to style the add-to-cart link, because this is still a button but it looks like a link, in my form i gave the input type submit a class="addtobaglink".
then i made an UDT for retrieve my url and i called it {my_url}
in the summarytemplate i added this form and put everything on 'hidden' except the submit buttonreturn 'http://'.$_SERVER['SERVER_NAME'].$_SERVER['REQUEST_URI']';
As you see in the form the {$actionid}returnid" value is empty ("") this is the redirect after the add-to-cart-link is pushed.
id}" />
I let it empty because i use the cart-preference "opening-page after add-to-cart" in the cart admin tab. but you can also put there the id of the page you want to be redirect after the add-to-cart-link is pushed.
But either it is empty and you use the cart admin preference or you put there the page-id to redirect to and set the admin cart preference to none.
Hope this will help some people
Kind regards
Peter
Re: [solved] 'add to cart' as a link
thnks lapak,lapak wrote: Great solution Just btw: you don't have to make UDT for url retrieval. There is also tag included in core of cmsms {rooturl} which do the same thing
if i put {rooturl} in as value for {$actionid}returnid" then i get an smarty error
i would like to stay in the same page where i clicked the link ... but i got now solution for this yet !
Peter
Re: [solved] 'add to cart' as a link
I didn't mean for returnid, {root_url} returns full url to root of your page ex. http://www.lumiart.cz, so I ment instead of your {my_url}, but then i realized, that you need url also with ?page= parameter, so I deleted my post, but you were quickerpedes wrote: thnks lapak,
if i put {rooturl} in as value for {$actionid}returnid" then i get an smarty error
i would like to stay in the same page where i clicked the link ... but i got now solution for this yet !
Peter
I know, that your solution works perfectly well, I'm just writing this, becaouse It's good to learn new and easier ways how to do things in cmsms, for next time
At first, I misswrite {rooturl} instead of {root_url}, thats why you get smarty error
And, than your UDT may be probably replaced with: {root_url}/?page={$page_alias}
And if you want returid set to actual page, you can have it in variable: {$content_id} but it's not necessary, just like you explained before...
Re: [solved] 'add to cart' as a link
thks lapak for your reply,lapak wrote: I didn't mean for returnid, {root_url} returns full url to root of your page ex. http://www.lumiart.cz, so I ment instead of your {my_url}, but then i realized, that you need url also with ?page= parameter, so I deleted my post, but you were quicker
I know, that your solution works perfectly well, I'm just writing this, becaouse It's good to learn new and easier ways how to do things in cmsms, for next time
At first, I misswrite {rooturl} instead of {root_url}, thats why you get smarty error
And, than your UDT may be probably replaced with: {root_url}/?page={$page_alias}
And if you want returid set to actual page, you can have it in variable: {$content_id} but it's not necessary, just like you explained before...
i tried your suggestions for {root_url}, {$content_id}
it is working fine
thank you very much
Peter
Re: [solved] 'add to cart' as a link
Now i just hit on quite simmilar thing, please, can you post your css style, where you achieved look like text?
Thanks a lot.
Thanks a lot.
Re: [solved] 'add to cart' as a link
hi lapak,
this is the css for the link styling, ofcourse you need to change your_div to yours
Kind regards
Peter
this is the css for the link styling, ofcourse you need to change your_div to yours
hope it will help you.#your_div input.addtobaglink {width: 48px; background-color: transparent; color: #fb8547; font-family: verdana, arial, sans-serif; margin-top: 0px; font-size: 10px; border: 0px solid #efeeee; float: left; cursor:pointer; padding: 3px 0 0 0;}
#your_div input.addtobaglink:hover {width: 48px; background-color: transparent; color: #fb8547; margin-top: 0px; font-size: 10px; border-bottom: 1px solid #fb8547; float: left; }
Kind regards
Peter
Re: [solved] 'add to cart' as a link
Working, thanks!pedes wrote: hi lapak,
this is the css for the link styling, ofcourse you need to change your_div to yourshope it will help you.#your_div input.addtobaglink {width: 48px; background-color: transparent; color: #fb8547; font-family: verdana, arial, sans-serif; margin-top: 0px; font-size: 10px; border: 0px solid #efeeee; float: left; cursor:pointer; padding: 3px 0 0 0;}
#your_div input.addtobaglink:hover {width: 48px; background-color: transparent; color: #fb8547; margin-top: 0px; font-size: 10px; border-bottom: 1px solid #fb8547; float: left; }
Kind regards
Peter