Announcement

Collapse
No announcement yet.

Different Secondary Currency Prices

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    Different Secondary Currency Prices

    Is it possible to manually enter in the product prices in our secondary currency so they are rounded off to the nearest 99c? At the moment we use the 'Also display prices in' option under the business settings.

    So a product that is £14.99 at a euro exchange rate of 1.14 will display at €17.09 where it would be better at €16.99.

    Is this possible at all?

    Thanks

    #2
    Using the inbuilt php engine could do this. You could use the productPriceRaw figure, format it how you want according to your own rules (setting a ceiling or a floor in maths terminology). In your posts you mention about rounding up to the nearest 99c, but then you actually detail a rounding down.

    The maths would work on the remainder of a price after you have divided it by 1.
    1. Convert to currency desired
    2. Obtain the number of cents leftover
    3. If the number of cents is 50 or more then you'd round up and vice versa


    You could simplify somewhat by using basic maths rounding to the total of the new currency. You'd then just take 0.01 off that total to give you the .99 ending.

    So 17.59 would round up to 18.00, you'd then remove 0.01 from it, to get 17.99

    or

    17.01 would round to 17.00 and the 0.01 removal would give you the 16.99

    Comment


      #3
      Thanks for that, but unfortunately my knowledge of the inbuilt php engine is not great. Where abouts would I start with this?

      Comment


        #4
        Depends how far you like to get stuck in really. php is what you need to learn which has thousands of tutorials on the web. If you're not great at things like that, then probably best not to start though tbh. If you started things and got stuck, you'd be most likely to get people jumping in and helping you fix/adjust. If you do nothing and hope for someone to do it all, it will probably be a bit of a long shot, the tendency in here is to help people when stuck not provide a free design service, but you might get someone on the right day who has something like this already and will share it for free. It's really hard to say.

        I think best options are to sacrifice half a day and learn about blocks and maths calculation using php (there are numerous php solutions to problems in the forum, so can always compare to see how things are formed etc.) or contact someone to do it for you. If you're not in a rush, hold on a day or so and see if anyone jumps in.

        It will have to be php though because of the math calculations required.

        Comment


          #5
          That's not quite what I asked. I asked "where do I start?" meaning where do I look first to begin to solve this solution? Not "how do I do php?" Or "Please can someone provide me with a free design service?"

          Why is it probably best not to start at all if not great at things like that when you can learn it?

          Comment


            #6
            You have to factor in your own personality and skills, only you can do that. I'd fully recommend learning it, it will add some great possibilities and future development opportunities for other things, it also gives a fab sense of achievement. But you have to accept, some people don't have the inclination or the spare time to do that, only you know if you do. Half a day solid on this could open up so many avenues to you if you can get it, if you can't then it's just a wasted half a day.

            Site owners generally have enough to be getting on with, without learning scripting languages they may never use again. It's horses for courses i guess, in the same way you'd not fit your own gas pipe or your own carpet, you get someone who knows what they're doing in to do it.

            There is no right or wrong answer, it's all about you as a person and how you react or take to new things. You might get it in 3 hours, someone else might not after 3 days, everyone is different. Like most things, the task itself is relatively easy to do, the years and years of experience that came before it are not.

            Go for it I say, you sound up for a challenge, which is perfect mindset on stuff like this.

            Comment


              #7
              Another way you could tackle it is by using using Excel and An import spreadheet. You would need to export all your products into Excel then apply a fomula as Lee sugested to give you your altrnative price then import them back into Actinic.
              Unusual Silver Jewellery
              Giftmill - Unusual Gifts
              Crystal Healing Jewellery
              Steampunk Jewellery

              Comment


                #8
                That's a good idea Andy, particularly as hierachical exports can fill out custom variables. An excel formula is a bit easier to do also and you generally find a lot more people able to hep with that. As i've used excel for 15 years now, i actually use the logic of their formulas to work out how i'd do something in php, which i am much less experienced in.

                Comment


                  #9
                  It's a little more complex than it seems. You can fix the displayed price on the product pages by editing the layout that displays the price. E.g. Product Price Excluding Tax.

                  In that layout the second currency is passed (as a string with the Euro symbol) via Variable TaxExclusivePriceAlt. This is added to the page by some PHP code. You could add some more PHP to strip the symbol and any thousands "," separators and do some maths. E.g. Replace all code in Product Price Excluding Tax with:
                  Code:
                  <actinic:block PHP='true'>
                  	$fudgedprice = str_replace(',', '', str_replace('€', '', '<actinic:variable name="TaxExclusivePriceAlt" selectable="false" />')); // get rid of symbol and any embedded commas
                  	$fudgedprice = round($fudgedprice) - 0.01; // round and adjust to .99
                  	$fudgedprice = sprintf("€%01.2f", $fudgedprice); // convert back to 2 decimal Euro
                  	priceformat("<actinic:variable name="SecondCurrencyFormat" selectable="false" />","<actinic:variable name="TaxExclusivePrice" selectable="false" />", $fudgedprice);
                  </actinic:block>
                  N.B. Only lightly tested.

                  However, this is only half the job. The second currency also displays in the Cart. You'd need to write similar code in Perl in ActinicOrder.pm to replicate the same functionality there. Probably in "sub FormatPrice".
                  Norman - www.drillpine.biz
                  Edinburgh, U K / Bitez, Turkey

                  Comment


                    #10
                    But...

                    Modifying the alternate price is not going to change the amount actually charged of course. The primary currency is what will be used and converted by the bank to the purchasers card currency.

                    It would only be really useful if the secondary currency could be the actual currency and price charged

                    Comment


                      #11
                      Because of how it is explained, i think it is just a guideline price on product layout he is after.

                      Comment


                        #12
                        Understood but I think it's a bit misleading as it gives the false impression that the second currency value is what will be charged. Then again perhaps that's after the fact and the sale is made.

                        Comment


                          #13
                          just a guideline price on product layout
                          That's how I saw it and that's what my code in post #9 does.
                          Norman - www.drillpine.biz
                          Edinburgh, U K / Bitez, Turkey

                          Comment


                            #14
                            I like the idea of reformatting the alt price as this keeps the exchange rate in the same place in business settings, that's a really good idea. The issues are then the cart (totally forgot about this), the price layouts used in marketing lists, permutation prices possibly, values in mini cart possibly and customer account prices if needed. That could be quite a task if some or all of those become issues, so i'd favour a standalone layout using the alt price within a product layout.

                            Comment


                              #15
                              My #9 tweak will also work on the marketing lists (you may need to make a similar tweak to Product Price Including Tax as some of these lists show inc tax). It's just the Cart (and possibly Customer prices but they may not be used on this site) that will need consideration.
                              Norman - www.drillpine.biz
                              Edinburgh, U K / Bitez, Turkey

                              Comment

                              Working...
                              X