Digital experiences for all disciplines
New Landing › How can we help? › Atelier › Showing Product URL Button Product Archive Page
New Landing › How can we help? › Atelier › Showing Product URL Button Product Archive Page
- This topic has 14 replies, 4 voices, and was last updated 9 years by Rui Guerreiro – SUPPORT.
-
Posted in: Atelier
-
July 30, 2015 at 2:28 pm #199371
Hi!
I want to be sure I do this the “right” way rather than hack it in a template.
All of my products are Amazon’s. I have put woocommerce in catalog mode.
On a single-product page, I see the button to buy just fine and the button uses the product URL product field. Great!
Now, I would like to show the same button to buy on the archive-product page in the woocommerce loop. I would also like to customize the class the button uses.
What is the best / right way to see the button to buy for each product in the product loop while in catalog mode?
Thanks!
(And it may be unnecessary but I want to say I LOVE the theme.)
July 30, 2015 at 3:33 pm #199393Hi,
In that situation I think you shouldn’t use the catalog mode and set your products as external product so it would jump for their respective Amazon link.
Check here in this page of the Woocommerce documentation.
http://docs.woothemes.com/document/managing-products/-Rui
July 30, 2015 at 3:47 pm #199398Oh.
Looks like that adds a “Read More” button rather than an external URL button. I just tried it out.
I’d rather not add a step / new page to the mix. I’d like people to be able to click right to Amazon within the output of the woocommerce loop on the archive-product page.
For my needs, it sounds like the best way to do this would be to use the button line from woocommerce/single-product/add-to-cartexternal.php and put it in woocommerce/archive-product.php in a child theme?
Did you have any other ideas?
Thanks for the quick reply!
July 30, 2015 at 4:56 pm #199433Check this code inside the Atelier/woocommerce/loop/add-to-cart.php
https://www.dropbox.com/s/xt30gzjq7u1ydws/Screenshot%202015-07-30%2016.48.04.png?dl=0Copy that file to the child theme maintaining the same directory structure
Then replace this line
$link['url'] = apply_filters( 'external_add_to_cart_url', get_permalink( $product->id ) );
by this one
$link['url'] = apply_filters( 'external_add_to_cart_url', esc_url( $product->get_product_url() ));
also change the Read More text.
Let us know if it worked.-Rui
July 30, 2015 at 5:08 pm #199441That worked!
Which is great…
But I’m not sure that it solves my problem.
I know the design of your suggestion is very sexy, and that’s great, but I’m going for simple, simple, simple.
I want to hit someone over the head with it. There should be no discovery of where to click to go to Amazon — it should be obvious.
I’d really just like it to be a button (href class button), just like the one in product-single, under the price of each item.
July 30, 2015 at 6:25 pm #199469We can hide the icon and show the other text. Would be something like this.
https://www.dropbox.com/s/9rt41ndrlv7yccz/Screenshot%202015-07-30%2018.24.23.png?dl=0-Rui
July 30, 2015 at 6:36 pm #199474๐
Yea… I don’t know.
It’s something about needing to hover over the image.
I’d much rather someone be able to make the leap immediately over to Amazon rather than spend more time, and possibly losing interest, on the next full product overview page.
And, please — don’t take my feedback as negative.
I think all of the options you have provided are fantastic! It makes a lot of sense for a target audience that is to be wowed or feel excited about the overall experience of the store.
That’s not my audience, however.
They are typically older and not as technically savvy as others.
Guiding them and giving them just a few options is the best user experience I can provide.
Also, my desire for a button is based in knowing what my audience likes about my existing site.
Again — this is all good stuff!!!
But I’m more interested in the best way to put a button on the description area div, not the image area div.
Thanks for the continued help and ideas.
July 30, 2015 at 6:37 pm #199475This reply has been marked as private.July 31, 2015 at 3:03 pm #199731Is it safe to assume that the only way I can do what I want is to hack it into a child-theme?
Thanks!
July 31, 2015 at 3:17 pm #199738Hi,
Do you any mocuk image of what you want to achieve regarding the product button?
https://www.dropbox.com/s/qa9zn46b2qyaiq8/Screenshot%202015-07-31%2015.10.32.png?dl=0Is something below the price?
Yes, this would have to be done in the child theme.
Regarding the custom work most part of the team is not available. Will check if someone is available.
We also advise the http://werkpress.com/-Rui
July 31, 2015 at 3:21 pm #199741I can make it happen… I just wanted to know if there was a “best practice” way to do it.
And I think that may have created the confusion.
Everything is ok! ๐
Child theme it is.
And, please, do let me know about availability by emailing me direct.
I’ll check out your recommendation in the meantime.
Thanks again!
July 31, 2015 at 3:24 pm #199742Ok no problem, thanks Rui
August 2, 2015 at 3:48 pm #199918If anyone else reading this thread is needing the same answer, here’s how I fixed this using my child functions.php file:
add_action( ‘woocommerce_after_shop_loop_item_title’, ‘woocommerce_external_add_to_cart’ );
That way, I did it in the “best practice” woocommerce way and didn’t need to hack it into a woocommerce template.
August 3, 2015 at 7:54 am #199983Hi,
Great thanks to sharing this solution.
MohammadAugust 3, 2015 at 7:57 am #199985Great. Thanks for sharing.
Unfortunately no one is available, check those guys from Werkpress.-Rui
-
Posted in: Atelier
You must be logged in and have valid license to reply to this topic.