Jump to content

TheTasteofAussie

New Members
  • Posts

    6
  • Joined

  • Last visited

TheTasteofAussie's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. To me it is just about the currencies. I can check the inputs from the merchants quite quickly however I need to manually make any changes. Some merchants don't put anything into the currency field and the default is USD. If I could change the default I would but that is another story again.
  2. Thank you, I'm now a lot closer but the page is still awry . Here is the whole template with the code added as a test. <table style="border: thin solid #E6E6E6; width: 100%; background-color: #cecece;"> <tr style="border: none;"> <td align="left" style="width: 50%; border: none; text-align: left;"><form method="get"> <div style="color: Black;">Products per page:</div><?php echo datafeedr_tools()->form_select("ppp", array( "12" => "12", "24" => "24", "36" => "36", "48" => "48", )); ?><input type="submit" value="Change" class="dfbuttoncat dfblue dfmedium dfrounded" style="background-color: #008dc2; width: 50%; margin-left: 30px;"></form></td> <td align="left" style="width: 50%; border: none; text-align: left;"><form method="get"> <div style="color: Black;">Sort by:</div><?php echo datafeedr_tools()->form_select("sort", array( "price" => "Price (low to high)", "-price" => "Price (high to low)", "name" => "Product Name (a - z)", "-name" => "Product Name (z - a)", )); ?><input type="submit" value="Sort" class="dfbuttoncat dfblue dfmedium dfrounded" style="background-color: #008dc2; width: 50%; margin-left: 30px;"></form></td> </tr></table> <div class="pl"> [product.each] <div class="t1 col3"> <div class="bdr"> <div class="thmb"><a href="[product.link]" title="[product.name]">[product.image tag='1']</a></div> <h2><a href="[product.link]" title="[product.name]">[product.name]</a></h2> <p class="desc">[product.description cut='20 words']</p> <?php if ($product->saleprice > 0 && $product->saleprice < $product->price) { ?> <div class="prc"> <small> $flag_path = "http://aussietaste.recipes/wp-content/uploads/flags/"; // note: currency SYM and SYM$ map to just SYM due to trimming of any trailing $ by the code // define an array that maps input values to output values $map['USD'] = array('flag'=>'Flag_of_the_United_States.jpg','symbol'=>'$USD'); $map['GBP'] = array('flag'=>'Flag_of_the_United_Kingdom.jpg"','symbol'=>'£'); $map['£'] = array('flag'=>'Flag_of_the_United_Kingdom.jpg"','symbol'=>'£'); $map['AUD'] = array('flag'=>'Flag_of_Australia.jpg','symbol'=>'$AUD'); // add other mappings here... $currency = $product->currency != '' ? rtrim($product->currency,'$') : 'AUD'; // use value (less any trailing $) or default to 'AUD' if(!isset($map[$currency])) { // no mapping exists echo "The currency value {$product->currency} isn't defined."; } else { // the currency is defined, use it $arr = $map[$currency]; $cur = "<img src='$flag_path{$arr['flag']}' alt='' /> {$arr['symbol']} "; ?> <div class='prc'> <small> <?php if($product->saleprice > 0 && $product->saleprice < $product->price){ echo 'On Sale: <span style="font-weight: bold; color:red;">'; echo $cur; echo " [product.saleprice]</span>"; } else { echo $cur; echo " [product.price]"; } ?> </small> </div> <?php } ?> </small> </div> <?php ?> <div class="btns"> [product.merchant_logo]<br><br> <a href="[product.link]" title="View details [product.name]" class="dfbutton dfblue dflarge dfrounded">More Details</a> </div> <div class="clearingdiv"> </div> </div> </div> [/product.each] <div class="clearingdiv"> </div> </div> <div class="pgr"> Pages: [pager.first text='<img src="[server.plugin_url]/first.gif" alt="first page" />' alt='<img src="[server.plugin_url]/first_off.gif" alt="first page" />'] [pager.prev text='<img src="[server.plugin_url]/prev.gif" alt="prev page" />' alt='<img src="[server.plugin_url]/prev_off.gif" alt="prev page" />'] [pager.pages] [pager.next text='<img src="[server.plugin_url]/next.gif" alt="next page" />' alt='<img src="[server.plugin_url]/next_off.gif" alt="next page" />'] [pager.last text='<img src="[server.plugin_url]/last.gif" alt="last page" />' alt='<img src="[server.plugin_url]/last_off.gif" alt="last page" />'] </div> I think I've missed something along the way
  3. I am using a third party to aggregate the datafeeds and the use a plugin to update my product database. There only place I can achieve the change is manually before I import to my website. That amounts to some 2000+ products. i think that the over head of the vaidation would be better than the time require tomanually edit each entry.
  4. I'm guessing DRY is a novice indicator, which is definitely my realm. Certainlylooking forward to an alternative. Thank you
  5. The problem I have is that when the data is imported from different sources some use the currency symbol and others use the text. What I am trying to achieve is a consitent pricing look. I have no control over the input data. And the problem I now have is for those entries that have no currency annotation. They are defaulting to $USD instead of $AUD.
  6. I have been told to add <?php if ( isset( $product->currency ) ) : ?> into the below code to check if the "currency" field has been set. If it hasn't been set (ie left empty) then I want to show the Aussie dollaras default <img src="http://aussietaste.recipes/wp-content/uploads/flags/Flag_of_Australia.jpg" /> $AUD I've tried putting it in different places and all I get is a blank page. I think there might need to be an "else" somewhere so i put in all sorts of different elseif's and still ended up with a blank page. I am wondering if anybody could put me on the right track please. Thanks Rowan <?php if ($product->saleprice > 0 && $product->saleprice < $product->price) { ?> <div class="prc"> <small> On Sale: <span style="font-weight: bold; color:red;"><?php if ($product->currency == 'USD') : ?> <img src="http://aussietaste.recipes/wp-content/uploads/flags/Flag_of_the_United_States.jpg" /> $USD <?php elseif ($product->currency == 'USD$') : ?> <img src="http://aussietaste.recipes/wp-content/uploads/flags/Flag_of_the_United_States.jpg" /> $USD <?php elseif ($product->currency == 'GBP') : ?> <img src="http://aussietaste.recipes/wp-content/uploads/flags/Flag_of_the_United_Kingdom.jpg" /> £ <?php elseif ($product->currency == '£') : ?> <img src="http://aussietaste.recipes/wp-content/uploads/flags/Flag_of_the_United_Kingdom.jpg" /> £ <?php elseif ($product->currency == 'AUD') : ?> <img src="http://aussietaste.recipes/wp-content/uploads/flags/Flag_of_Australia.jpg" /> $AUD <?php elseif ($product->currency == 'AUD$') : ?> <img src="http://aussietaste.recipes/wp-content/uploads/flags/Flag_of_Australia.jpg" /> $AUD <?php elseif ($product->currency == 'CDN$') : ?> <img src="http://aussietaste.recipes/wp-content/uploads/flags/Flag_of_Canada.jpg" /> $CDN <?php elseif ($product->currency == 'RM') : ?> <img src="http://aussietaste.recipes/wp-content/uploads/flags/Flag_of_Malaysia.jpg" /> <?php elseif ($product->currency == 'CDN') : ?> <img src="http://aussietaste.recipes/wp-content/uploads/flags/Flag_of_Canada.jpg" /> $CDN <?php elseif ($product->currency == 'NZD') : ?> <img src="http://aussietaste.recipes/wp-content/uploads/flags/Flag_of_New_Zealand.jpg" /> $NZD <?php elseif ($product->currency == 'NZD$') : ?> <img src="http://aussietaste.recipes/wp-content/uploads/flags/Flag_of_New_Zealand.jpg" /> $NZD <?php endif; ?> [product.saleprice]</span> </small> </div> <?php } else { ?> <div class="prc"> <small> <?php if ($product->currency == 'USD') : ?> <img src="http://aussietaste.recipes/wp-content/uploads/flags/Flag_of_the_United_States.jpg" /> $USD <?php elseif ($product->currency == 'USD$') : ?> <img src="http://aussietaste.recipes/wp-content/uploads/flags/Flag_of_the_United_States.jpg" /> $USD <?php elseif ($product->currency == 'GBP') : ?> <img src="http://aussietaste.recipes/wp-content/uploads/flags/Flag_of_the_United_Kingdom.jpg" /> £ <?php elseif ($product->currency == '£') : ?> <img src="http://aussietaste.recipes/wp-content/uploads/flags/Flag_of_the_United_Kingdom.jpg" /> £ <?php elseif ($product->currency == 'AUD') : ?> <img src="http://aussietaste.recipes/wp-content/uploads/flags/Flag_of_Australia.jpg" /> $AUD <?php elseif ($product->currency == 'AUD$') : ?> <img src="http://aussietaste.recipes/wp-content/uploads/flags/Flag_of_Australia.jpg" /> $AUD <?php elseif ($product->currency == 'CDN$') : ?> <img src="http://aussietaste.recipes/wp-content/uploads/flags/Flag_of_Canada.jpg" /> $CDN <?php elseif ($product->currency == 'RM') : ?> <img src="http://aussietaste.recipes/wp-content/uploads/flags/Flag_of_Malaysia.jpg" /> <?php elseif ($product->currency == 'CDN') : ?> <img src="http://aussietaste.recipes/wp-content/uploads/flags/Flag_of_Canada.jpg" /> $CDN <?php elseif ($product->currency == 'NZD') : ?> <img src="http://aussietaste.recipes/wp-content/uploads/flags/Flag_of_New_Zealand.jpg" /> $NZD <?php elseif ($product->currency == 'NZD$') : ?> <img src="http://aussietaste.recipes/wp-content/uploads/flags/Flag_of_New_Zealand.jpg" /> $NZD <?php endif; ?> [product.price] </small> </div> <?php } ?>
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.