I have spent time working on updates and refreshes to this website and provided a range of other related services to Luxe Watches. They had a website developed as a bespoke pseudo CMS but lost contact with the original developer.
I was called in to provide fixes and updates to the website. Much of the core functionality was okay, with some partial re-writing of PHP/Database interactions as well as major database updates to allow extra details to be listed for products.
The updates made were to the front and back end of the website. The Ebay updates were to their Ebay Shop which they use to boost sales and to provide another platform for reaching out to customers.
This was a full website refresh with reuse of core functionality. The key aspects of the refresh were the footer which is built up on page load from PHP querying the database and building up lists of all product brands and sub-brands and listing them as ‘ brand available: sub-brand1 sub-brand2 sub-brand3’.
Over-layers were updated and added on product pages where the product is no longer available or sold.
Homepage Layout was re-created with an updated layout, navigation updates and input box updates.
Google Shopper XML was developed and implemented into the Google Merchant Centre. The XML is built up according to Google’s specification using PHP and database queries. The retrieved data is translated into an XML document and downloadable as well as being saved on the server. The saved file is automatically retrieved by the Shopper API.
WordPress installed, set up and linked to from the main website.
Ebay Store Product Description Page
This was a HTML template with PHP and database queries built to speed up Custom Ebay Product Listing creation.
The HTML was created based on a PSD design. The PHP was used to populate the relevant data fields such as product description, price etc with the information relevent to the product to be listed in Ebay.
Ebay Store Template
This was a HTML template created for an Ebay store. The HTML consists of a header used on the general store pages and product listing pages. CSS was used to position the aspects such as navigation and logo from an externally referenced CSS file.
This was a minor update to the existing website. An update to the testimonials by way of a user form and functionality to email the form to an administrator. The Testimonial can be approved after which it is displayed on the testimonials page with pagination displayed when over a defined number of testimonials have been approved.
Update to Ebay Template
Luxe Watches had their website updated by a separate agency, however they also needed their Ebay template generator updating which i was tasked to do seeing as i created the previous one.
I achieved this using Yeoman and one of the amazing boilerplate generators, namely Wp Plugin Boilerplate, which i have to say was fantastically simple to use.
The new template had to be based on the new html for the new look of the website. I didn’t have any, except what was on the dev website. So I basically lifted as much of the html that seemed logcal at the time.
It was alright enough, although there was functionality to change the price that i had to replicate with a big assumption that it would even be possible on the Ebay website.
Creating the template, or recreating as was the case, was relatively simple. I rebuilt the page as i could see it on the dev site and so that it fit within the frame of the Ebay website.
The difficulties arose in the changing of the price. I am not aware of there being an Ebay product price conversion tool that you can consume within your custom product description, so i had to contrive a way that i could change the price, which i had care of the database, into USD and EUR.
I ended up using Mashape which had an API listed to convert currency.
I had used Mashape before, so was aware of how to consume the APIs, what i was unsure was if i could consume then within the WordPress plugin.
The code to consume the api is all on the Mashape website. You may need to create an account in order to get a public key.
This allowed me to consume the api to get the amount of pounds per euro and dollar.
To consume from the endpoint, Mashapre recommends using Unirest, which is a small HTTP proxy library.
$usd = Unirest\Request::get("https://currencyconverter.p.mashape.com/?from=GBP&from_amount=1&to=USD", array( "X-Mashape-Key" => "public_key", "Accept" => "application/json" ) );
Using this from within WordPress was fine on my local machine, and then on my server. The problems showed their head when i pushed to the clients server.
The problem lay with the PHP version installed on the server of the client, 5.3.9. Unirest makes use of hex2bin to convert the hex response from the Mashape api into text.
I was a bit stuck, until i realised through good old stack exchange that one can right one’s own hex2bin equivalent… see here.
This meant that the PHP version could stay as it was, even tho thats a silly thing to do, but it wasn’t my server or call.
The next issue was with the plugin generator i used. Admittedly, the generator was great for creating the skeleton and acted as a great boilerplate, it did have one small flaw. It used HTTP includes to insert the HTML partials into the WordPress admin.
I dont know, as i havent read up yet, whether this is standard practice. I would assume not.
Never-the-less, the fact that this was an issue only raised its head when i pushed to the clients, the reason being that they had the PHP setting allow_url_include set to false.
My work around is in this post.
As simple as these workarounds where, they didn’t half slow me down.