Currency problem
-
Hi Jay,
Got to say love the plug in. Fantastic nothing else like it out there.
Having a small issue with currency. Trying to set up a site and I have changed the currency to pound sterling. This changes to sterling on the vehicle page however on the vehicle list page it still displays in dollars. Is there anyway I can amend this?
Thanks,
Ryan
-
Hi Ryan,
Sorry for the delay in getting back with you. Are you using the styles PlugIn or were you having this issue with just the main PlugIn? The function that displays the price for both of those pages is the same, so I need just a little more info to help debug the cause of the problem. If you can provide a link to your site it might help determine the cause.
thanks,
-jayHi Jay,
Thanks for getting back to me. I have worked out it is something to do with the styles plugin as it appears fine when using the default theme.
Its almost like the styles doesn’t recognize that the currency has been changed for the vehicle list page, however it does for the vehicle detail page.
http://www.mjchurchusedsales.com/cars-for-sale
Any help much appreciated.
Many thanks,
RyanIt’s a problem with the styles PlugIn. I forgot to add the code to handle the currency code. I’ll include the fix in the next update for the styles plugin.
If you’ll go to the following file
car-demon-styles->theme-files->responsive->responsive-style-include.phpThen go to line #92 to the function get_vehicle_price_style_responsive() and replace it with the following it should fix your problem;
function get_vehicle_price_style_responsive($post_id) { $vehicle_location = strip_tags(get_the_term_list( $post_id, 'vehicle_location', '','', '', '' )); if ($vehicle_location == '') { $vehicle_location = 'Default'; $vehicle_location_slug = 'default'; } else { $vehicle_location_term = get_term_by('name', $vehicle_location, 'vehicle_location'); $vehicle_location_slug = $vehicle_location_term->slug; } $vehicle_condition = strip_tags(get_the_term_list( $post_id, 'vehicle_condition', '','', '', '' )); if ($vehicle_condition == 'New') { $show_price = get_option($vehicle_location_slug.'_show_new_prices'); } else { $show_price = get_option($vehicle_location_slug.'_show_used_prices'); } $price = ''; if ($show_price == 'Yes') { if (isset($_SESSION['car_demon_options']['currency_symbol'])) { $currency_symbol = $_SESSION['car_demon_options']['currency_symbol']; } else { $currency_symbol = "$"; } if (isset($_SESSION['car_demon_options']['currency_symbol_after'])) { $currency_symbol_after = $_SESSION['car_demon_options']['currency_symbol_after']; if (!empty($currency_symbol_after)) { $currency_symbol = ""; } } else { $currency_symbol_after = ""; } $vehicle_price = get_post_meta($post_id, "_price_value", true); $vehicle_price_pack = (int)$vehicle_price; if ($vehicle_price == 0) { $vehicle_price = ' Call '; } $selling_price = get_post_meta($post_id, "_msrp_value", true); $rebate = get_post_meta($post_id, "_rebates_value", true); $dealer_discount = get_post_meta($post_id, "_discount_value", true); $your_price = $vehicle_price; $spacer = ""; if (!empty($selling_price)) { $selling_price_label = get_post_meta($post_id, '_msrp_label', true); if (empty($selling_price_label)) { $selling_price_label = __('Selling Price', 'car-demon'); } $price .= '<div class="price_label">'.$selling_price_label.'</div><div class="price_value"> '.$currency_symbol.$selling_price.$currency_symbol_after.'</div>'; } if (!empty($rebate)) { $rebate_label = get_post_meta($post_id, '_rebate_label', true); if (empty($rebate_label)) { $rebate_label = __('Rebate', 'car-demon'); } $price .= '<div class="price_label">'.$rebate_label.'</div><div class="price_value"> '. $currency_symbol.$rebate.$currency_symbol_after.'</div>'; } else { $spacer = '<div class="price_label"> </div><div class="price_value"></div>'; } if (!empty($dealer_discount)){ $discount_label = get_post_meta($post_id, '_discount_label', true); if (empty($discount_label)) { $discount_label = __('Xtra Discount', 'car-demon'); } $price .= '<div class="price_label">'.$discount_label.'</div><div class="price_value">'. $currency_symbol.$dealer_discount.$currency_symbol_after.'</div>'; } else { $spacer = '<div class="price_label"> </div><div class="price_value"></div>'; } $price_label = get_post_meta($post_id, '_price_label', true); if (empty($price_label)) { $price_label = __('Your Price', 'car-demon'); } $price .= '<div class="price_line"> </div>'; $price .= '<div class="final_price_label">'.$price_label.': </div>'; $price .= '<div class="final_price_value">'.$currency_symbol.$your_price.$currency_symbol_after.'</div>'; } else { if ($vehicle_condition == 'New') { $price .= '<div class="no_price_style">'.get_option($vehicle_location_slug.'_no_new_price').get_option($vehicle_location_slug.'_new_sales_number').'</div>'; } else { $price .= '<div class="no_price_style">'.get_option($vehicle_location_slug.'_no_used_price').'<br />'.get_option($vehicle_location_slug.'_used_sales_number').'</div>'; } } $sold_status = get_post_meta($post_id, "sold", true); if ($sold_status == 'yes') { $pluginpath = str_replace(str_replace('\\', '/', ABSPATH), get_option('siteurl').'/', str_replace('\\', '/', dirname(__FILE__))).'/'; $pluginpath = str_replace('includes','',$pluginpath); $price = '<div id="your_price_text" class="your_price_text_style">'; $price .= '<img src="'.$pluginpath.'images\sold.gif" alt="Sold" title="Sold" /><br />'; $price .= '</div>'; } $price = '<div class="price">'.$price.'</div>'; return $price; }Hi Jay,
Thanks very much for your help this has solved the problem!
I will be donating shortly as your plug in is fantastic and it is a great job you are doing with the development and support.
Much appreciated,
RyanHey Ryan,
Thanks for the kind words. I’m glad I was able to help. I really appreciate the feedback and the bug report. I also am grateful you helped confirm this solved the problem.
I’ve been a WordPress user for a great many years and so many people have helped me. I started this project as a way to give back to the community that has given me so much. It’s good to know that I’m on the right track π
On a side note I love the theme, I checked your site out this morning and it looks really good.
FWIW: This also fixed it for me using car demon style plugin and responsive. Thanks.
The topic ‘Currency problem’ is closed to new replies.