Jump to content

Currency variable on custom pages


slman

Recommended Posts

Hello!

1) I implemented currency change variable in the cart, and its working good, but i switched from using the cart to show my product to showing my product on custom pages to make it more neat. The currency is not changeable in the custom page, I want to get the price by using the product id + having the prefix of the currency (to make it update with currency conversion changes).

2) I want to show Kuwait + Saudi Arabia + USA flag in the currency converter, I was only able to get the us flag from flags.png in /templates/(theme)/img

Thank you

Link to comment
Share on other sites

11 hours ago, slman said:

1) I implemented currency change variable in the cart, and its working good, but i switched from using the cart to show my product to showing my product on custom pages to make it more neat. The currency is not changeable in the custom page, I want to get the price by using the product id + having the prefix of the currency (to make it update with currency conversion changes).

i'm not sure if these custom pages are within WHMCS or not, or if you're using a currency selector in the header...

if there's aren't a log of prices to be shown on the page, using a data feed would be an option...

possibly if these custom pages are within WHMCS, you could use a hook instead.

11 hours ago, slman said:

2) I want to show Kuwait + Saudi Arabia + USA flag in the currency converter, I was only able to get the us flag from flags.png in /templates/(theme)/img

quickest way would just be to get the flags from a third-party site, there will be plenty of free sites out there, e.g countryflags.com (!) - just ensure that you get all the flags you need so that the style of them all is the same... and then use them rather than the ones supplied by WHMCS or your theme.

Link to comment
Share on other sites

On 30/05/2020 at 11:28 AM, brian! said:

i'm not sure if these custom pages are within WHMCS or not, or if you're using a currency selector in the header...

if there's aren't a log of prices to be shown on the page, using a data feed would be an option...

possibly if these custom pages are within WHMCS, you could use a hook instead.

quickest way would just be to get the flags from a third-party site, there will be plenty of free sites out there, e.g countryflags.com (!) - just ensure that you get all the flags you need so that the style of them all is the same... and then use them rather than the ones supplied by WHMCS or your theme.

My custom pages are within WHMCS, I want to get the price from the ID without using Data Feed, and yes, I am using a currency selector in the header.

Regarding the flags, How can I assign each flag to its currency?

Link to comment
Share on other sites

1 hour ago, slman said:

My custom pages are within WHMCS, I want to get the price from the ID without using Data Feed, and yes, I am using a currency selector in the header.

using a feed would be simpler, but if you want to go down the hook route, then it's going to be a ClientAreaPage hook, ideally limited to running on just this custom page, that pulls prices for a list of given PIDs, using a specified billing cycle, the current currency value, from the database, formats it in the correct currency layout and returns them as an array/variables to the template.

1 hour ago, slman said:

Regarding the flags, How can I assign each flag to its currency?

I would need to see the code you're using, but generally I would make the flag filenames the same as the currency's 3-letter abbreviation and reference them that way.

Edited by brian!
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use & Guidelines and understand your posts will initially be pre-moderated