Results 1 to 10 of 10
  1. #1
    Join Date
    Jan 2021
    Posts
    32
    Plugin Contributions
    0

    Default Currencies drop down menu in products page?

    Hi,
    The currencies option is there in the header and side box.
    I want it in the products page
    I created a drop down menu for currencies in the products page using attribute controller. (See the screenshot below)
    I want to make it functional so that customers can choose the currency from this drop down menu on products page.
    How to do it.

    Click image for larger version. 

Name:	Currency Option.png 
Views:	119 
Size:	10.9 KB 
ID:	19394

  2. #2
    Join Date
    Jan 2004
    Posts
    66,364
    Blog Entries
    7
    Plugin Contributions
    274

    Default Re: Currencies drop down menu in products page?

    If your desire is that the currency dropdown "change the price according to the selected currency", then attributes are not the way to do it. Use the currencies "sidebox" for that, so that it changes all product prices on the store all at the same time ... and make a practice of updating your store's exchange rates weekly.
    https://docs.zen-cart.com/user/local...n/my_currency/

    However, if your purpose for a currency choice via attributes is to denote the topic of a PDF ebook or something, and your currency choices are just textual information, then attributes are fine. You can create the dropdown as you would any other dropdown, adding choices by hand. And then later associate the appropriate download with each combination of selected attributes.
    https://docs.zen-cart.com/user/produ...tributes_info/
    .

    Zen Cart - putting the dream of business ownership within reach of anyone!
    Donate to: DrByte directly or to the Zen Cart team as a whole

    Remember: Any code suggestions you see here are merely suggestions. You assume full responsibility for your use of any such suggestions, including any impact ANY alterations you make to your site may have on your PCI compliance.
    Furthermore, any advice you see here about PCI matters is merely an opinion, and should not be relied upon as "official". Official PCI information should be obtained from the PCI Security Council directly or from one of their authorized Assessors.

  3. #3
    Join Date
    Jan 2021
    Posts
    32
    Plugin Contributions
    0

    Default Re: Currencies drop down menu in products page?

    Quote Originally Posted by DrByte View Post
    If your desire is that the currency dropdown "change the price according to the selected currency", then attributes are not the way to do it. Use the currencies "sidebox" for that, so that it changes all product prices on the store all at the same time ... and make a practice of updating your store's exchange rates weekly.
    https://docs.zen-cart.com/user/local...n/my_currency/

    However, if your purpose for a currency choice via attributes is to denote the topic of a PDF ebook or something, and your currency choices are just textual information, then attributes are fine. You can create the dropdown as you would any other dropdown, adding choices by hand. And then later associate the appropriate download with each combination of selected attributes.
    https://docs.zen-cart.com/user/produ...tributes_info/
    Hi,
    Yes, there are currency dropdown in the header and side box.
    But I want them just above the "add to the cart" button ( as shown in the attached screenshot).
    My desire is to change the price according to the selected currency, but the dropdown option should be just above the add to cart button to make things easier for the customer.
    How can this be done?

  4. #4
    Join Date
    Jan 2004
    Posts
    66,364
    Blog Entries
    7
    Plugin Contributions
    274

    Default Re: Currencies drop down menu in products page?

    Quote Originally Posted by RK123 View Post
    Yes, there are currency dropdown in the header and side box.
    Quote Originally Posted by RK123 View Post
    to make things easier for the customer.
    With respect, I ask: Are actual real customers asking for this? Are they actually picking up the telephone and calling you and saying they can't find the currency-selectors already in the header and sidebox?

    In most cultures I've interacted with, when a price is displayed in something other than the desired currency, the first thing the customer does is look for an option to change currencies: usually to see whether their own currency is supported, or at least one that they prefer to pay with. Every time, they intuitively click on the name of that currency and see the site's prices immediately change to that currency.

    Quote Originally Posted by RK123 View Post
    How can this be done?
    It's quite complicated, because to do that would require breaking up the product page template in a way that doesn't make logical sense, both in terms of usability and in the actual page's HTML code which the browser must interpret.
    The technical issue is that what you're asking for is a form injected inside another form, which isn't possible in HTML.

    If you have advanced coding skills you could explore writing an ajax widget that sits outside the form but use CSS and javascript to position it near the Add button. But then you still also need to have it intelligently understand the selections the customer has started to make for the product but which they haven't actually "saved"/submitted yet, else you're no further ahead than just using the dropdowns already on the page.

    It really sounds like you're making it much harder on yourself than necessary.
    And if you haven't actually surveyed your customers to find out whether they're completely unable to see/use the existing currency selector, then you're over-engineering things.
    .

    Zen Cart - putting the dream of business ownership within reach of anyone!
    Donate to: DrByte directly or to the Zen Cart team as a whole

    Remember: Any code suggestions you see here are merely suggestions. You assume full responsibility for your use of any such suggestions, including any impact ANY alterations you make to your site may have on your PCI compliance.
    Furthermore, any advice you see here about PCI matters is merely an opinion, and should not be relied upon as "official". Official PCI information should be obtained from the PCI Security Council directly or from one of their authorized Assessors.

  5. #5
    Join Date
    Jan 2021
    Posts
    32
    Plugin Contributions
    0

    Default Re: Currencies drop down menu in products page?

    Quote Originally Posted by DrByte View Post
    With respect, I ask: Are actual real customers asking for this? Are they actually picking up the telephone and calling you and saying they can't find the currency-selectors already in the header and sidebox?

    In most cultures I've interacted with, when a price is displayed in something other than the desired currency, the first thing the customer does is look for an option to change currencies: usually to see whether their own currency is supported, or at least one that they prefer to pay with. Every time, they intuitively click on the name of that currency and see the site's prices immediately change to that currency.


    It's quite complicated, because to do that would require breaking up the product page template in a way that doesn't make logical sense, both in terms of usability and in the actual page's HTML code which the browser must interpret.
    The technical issue is that what you're asking for is a form injected inside another form, which isn't possible in HTML.

    If you have advanced coding skills you could explore writing an ajax widget that sits outside the form but use CSS and javascript to position it near the Add button. But then you still also need to have it intelligently understand the selections the customer has started to make for the product but which they haven't actually "saved"/submitted yet, else you're no further ahead than just using the dropdowns already on the page.

    It really sounds like you're making it much harder on yourself than necessary.
    And if you haven't actually surveyed your customers to find out whether they're completely unable to see/use the existing currency selector, then you're over-engineering things.
    Thanks for explaining that it is a very complicated thing to do.
    I will keep it simple
    I have left a message below "add to the cart" asking the customer to choose the currency from the side box before adding the product to the cart.

    (But if someone comes up with this code/widget so that currency is displayed in the products page or at least in the shopping cart, it would be great).

  6. #6
    Join Date
    Jul 2012
    Posts
    16,719
    Plugin Contributions
    17

    Default Re: Currencies drop down menu in products page?

    This is starting to sound more like an issue with the checkout process than anything else... I'll ask the question a different way:

    why does the customer need to select a currency other than what is displayed? What problem is being resolved?

    Isn't the currency option available on the shopping cart page the same way it is on other pages? (eg: in header and/or sidebox)

    (While altering the shopping cart page isn't quite as "bad" as a product page in terms of inserting another form inside a form, it does have its complications as well.)
    ZC Installation/Maintenance Support <- Site
    Contribution for contributions welcome...

  7. #7
    Join Date
    Jan 2021
    Posts
    32
    Plugin Contributions
    0

    Default Re: Currencies drop down menu in products page?

    Quote Originally Posted by mc12345678 View Post
    This is starting to sound more like an issue with the checkout process than anything else... I'll ask the question a different way:

    why does the customer need to select a currency other than what is displayed? What problem is being resolved?

    Isn't the currency option available on the shopping cart page the same way it is on other pages? (eg: in header and/or sidebox)

    (While altering the shopping cart page isn't quite as "bad" as a product page in terms of inserting another form inside a form, it does have its complications as well.)
    There is one default currency and multiple other currencies added.
    Customers are from different countries.
    So the default currency may not be the one they would like to do the transaction.
    Yes, there are options to choose the currency from a dropdown menu in the header and in the sidebox.. But they are a little from the product description and customers may not note it.
    So if the currency dropdown menu is close to the add to cart button ( as shown in the screenshot attached in my first post) , the customers will know that they can choose the currency of their choice.
    So this is what I want.
    Last edited by RK123; 4 Feb 2021 at 03:43 AM.

  8. #8
    Join Date
    Jul 2012
    Posts
    16,719
    Plugin Contributions
    17

    Default Re: Currencies drop down menu in products page?

    Quote Originally Posted by RK123 View Post
    There is one default currency and multiple other currencies added.
    Customers are from different countries.
    So the default currency may not be the one they would like to do the transaction.
    Yes, there are options to choose the currency from a dropdown menu in the header and in the sidebox.. But they are a little from the product description and customers may not note it.
    So if the currency dropdown menu is close to the add to cart button ( as shown in the screenshot attached in my first post) , the customers will know that they can choose the currency of their choice.
    So this is what I want.
    If you look at the configuration menu->My Store... What are the settings for Switch to Default Language Currency and Language Selector?

    Sounds like those two should be set to True and Browser respectively.

    There is some more information (though doesn't cover everything) in the docs: How do I use another currency instead of US Dollars? | Zen Cart Documentation Although the title may not seem complete it does appear to cover the requested action so that the currency is more likely to appear as desired/needed.
    ZC Installation/Maintenance Support <- Site
    Contribution for contributions welcome...

  9. #9
    Join Date
    Jan 2004
    Posts
    66,364
    Blog Entries
    7
    Plugin Contributions
    274

    Default Re: Currencies drop down menu in products page?

    /includes/templates/NAME_OF_YOUR_TEMPLATE/templates/tpl_shopping_cart_default.php

    This displays the shopping cart page.

    Feel free to add some helpful instructions by changing the following:
    Code:
    <div id="cartSubTotal"><?php echo SUB_TITLE_SUB_TOTAL; ?> <?php echo $cartShowTotal; ?></div>
    to
    Code:
    <div id="cartSubTotal"><?php echo SUB_TITLE_SUB_TOTAL; ?> <?php echo $cartShowTotal; ?>
    <p>To see the price in another currency, use the dropdown at the top of the page</p>
    </div>
    or reposition that same addition to someplace else on the page where you prefer to display it.
    .

    Zen Cart - putting the dream of business ownership within reach of anyone!
    Donate to: DrByte directly or to the Zen Cart team as a whole

    Remember: Any code suggestions you see here are merely suggestions. You assume full responsibility for your use of any such suggestions, including any impact ANY alterations you make to your site may have on your PCI compliance.
    Furthermore, any advice you see here about PCI matters is merely an opinion, and should not be relied upon as "official". Official PCI information should be obtained from the PCI Security Council directly or from one of their authorized Assessors.

  10. #10
    Join Date
    Dec 2007
    Location
    Payson, AZ
    Posts
    1,076
    Plugin Contributions
    15

    Default Re: Currencies drop down menu in products page?

    Quote Originally Posted by RK123 View Post
    So if the currency dropdown menu is close to the add to cart button ( as shown in the screenshot attached in my first post) , the customers will know that they can choose the currency of their choice.
    So this is what I want.
    There are so many reasons not to do this. Even the big shops have it in the header.. Changing country, currencies, and language is a big deal across the entire site...

    But to each there own... as pointed out forms can not be nested with out a hack or script.. but form start/stop can be moved providing you think of what's affected when you start moving things around. The product page really don't have anything requiring from action above the product title. So if you move the form start below the product title then create the currencies dropdown form above it... as below.. in red..
    Code:
    <div id="prod-info-top">
    <!--bof Product Name-->
    <h1 id="productName" class="productGeneral"><?php echo $products_name; ?></h1>
    <!--eof Product Name-->
    
    <div id="currency_product" class="topBox forward">
    <?php echo zen_draw_form('currencies_form_header', zen_href_link(basename(preg_replace('/.php/','', $PHP_SELF)), '', $request_type, false), 'get');
         $currencies_array = array();
          foreach($currencies->currencies as $key => $value) {
            $currencies_array[] = array('id' => $key, 'text' => $value['title']);
          }
          $hidden_get_variables = zen_post_all_get_params('currency');
         echo 'Currencies:&nbsp;&nbsp;' . zen_draw_pull_down_menu('currency', $currencies_array, $_SESSION['currency'], 'onchange="this.form.submit();" class="header"') . $hidden_get_variables . zen_hide_session_id();  ?>
    </form>
    </div>
        
    <!--bof Form start-->
    <?php echo zen_draw_form('cart_quantity', zen_href_link(zen_get_info_page($_GET['products_id']), zen_get_all_get_params(array('action')) . 'action=add_product', $request_type), 'post', 'enctype="multipart/form-data"') . "\n"; ?>
    <!--eof Form start-->
    
    <div id="pinfo-left" class="group">
    <!--bof Main Product Image -->
    Click image for larger version. 

Name:	cur_box.png 
Views:	37 
Size:	37.9 KB 
ID:	19411
    That's as close as you can get it without using CSS to place it within the price block... which I really don't have time to get into..
    Dave
    Always forward thinking... Lost my mind!

 

 

Similar Threads

  1. Single products with drop down menu variables
    By lapitis in forum Templates, Stylesheets, Page Layout
    Replies: 8
    Last Post: 2 Dec 2014, 08:18 PM
  2. Ez page not showing in drop down menu?
    By znowflake in forum General Questions
    Replies: 2
    Last Post: 9 Sep 2010, 06:47 PM
  3. Drop down menu options for products?
    By mreateg in forum General Questions
    Replies: 1
    Last Post: 6 Jun 2008, 10:13 PM
  4. Adding products to manufacturers drop down menu
    By keef6666 in forum Templates, Stylesheets, Page Layout
    Replies: 9
    Last Post: 29 Feb 2008, 07:51 PM
  5. Drop Down Menu for Products
    By Dreameffects in forum General Questions
    Replies: 0
    Last Post: 29 Jan 2008, 11:11 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
disjunctive-egg
Zen-Cart, Internet Selling Services, Klamath Falls, OR