{"id":4275,"date":"2020-06-14T17:13:17","date_gmt":"2020-06-14T15:13:17","guid":{"rendered":"https:\/\/www.nieuwsmarkt.nl\/?p=4275"},"modified":"2020-06-14T18:22:32","modified_gmt":"2020-06-14T16:22:32","slug":"a-challenging-job","status":"publish","type":"post","link":"https:\/\/www.nieuwsmarkt.nl\/nl\/blog\/2020\/06\/14\/a-challenging-job\/","title":{"rendered":"Een flinke uitdaging"},"content":{"rendered":"<p><strong>Een webshop maken, die bij aanvang nog geen betaalfuncties hoeft te te hebben in een meertalige omgeving, is best een uitdaging. Aangevuld met de wens dat alle artikelen vanuit een .csv bestand worden ge\u00efmporteerd.<\/strong><\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"728\" src=\"https:\/\/www.nieuwsmarkt.nl\/wp-content\/uploads\/2020\/06\/header-article-woocomerce-wpml-1024x728.jpg\" alt=\"\" class=\"wp-image-4398\" srcset=\"https:\/\/www.nieuwsmarkt.nl\/wp-content\/uploads\/2020\/06\/header-article-woocomerce-wpml-1024x728.jpg 1024w, https:\/\/www.nieuwsmarkt.nl\/wp-content\/uploads\/2020\/06\/header-article-woocomerce-wpml-300x213.jpg 300w, https:\/\/www.nieuwsmarkt.nl\/wp-content\/uploads\/2020\/06\/header-article-woocomerce-wpml-768x546.jpg 768w, https:\/\/www.nieuwsmarkt.nl\/wp-content\/uploads\/2020\/06\/header-article-woocomerce-wpml-1536x1092.jpg 1536w, https:\/\/www.nieuwsmarkt.nl\/wp-content\/uploads\/2020\/06\/header-article-woocomerce-wpml-2048x1457.jpg 2048w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<h3 class=\"wp-block-heading\">Creative and Functional design<\/h3>\n\n\n\n<p>Het creatieve- en functionele ontwerp werd opgeleverd in een soort 'work in progress' stappenplan, met enkele wijzigingen gedurende het 'traject'. Het perspectief van de klant was zeer creatief aan de ene kant (ze is een part-time sieraden ontwerper\/maker) en zeer technisch aan de andere kant (ze is een software proces ingenieur in de zware industrie).<\/p>\n\n\n\n<blockquote class=\"wp-block-quote is-layout-flow wp-block-quote-is-layout-flow\"><p>The creative design was pre-delivered<\/p><\/blockquote>\n\n\n\n<p>However it still remains important to keep a tracklist of &#8216;all things done&#8217; in an overview. Especially to &#8216;come back later&#8217; if things need to be changed. With a missing functional design you are &#8216;left on your own&#8217;, at the moment the customer requests for something new&#8230;&#8230; At any random times, even years after the first delivery&#8230;&#8230;<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Themer to &#8216;prevent&#8217; WooCommerce functions<\/h3>\n\n\n\n<p>From a plug-ins perspective, making a WooCommerce webshop without being a shop at first, means that Beaver Themer comes in to make to right templates for the shops products overview, the category views and the individual product views. Themer is there to &#8216;filter out&#8217; all the basket and payment functionality out of WooCommerce, but keeping the possibilities open to add them later, onze online shopping will be requested. It is therefore we made the decission to use WooCommerce from the very first beginning.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Importing a csv file for the products catalogue<\/h3>\n\n\n\n<p>With about a little less than 80 products the &#8216;shop&#8217; in rather small, but the client requested to be able to import all products everytime at one, after she would decide to make some changes in a Microsoft Access database enad export that database to a CSV file, to be able to overwrite existing products (if needed) with new data and add new products as soon as they become available.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Translating with WPML<\/h3>\n\n\n\n<p>The next challenge was to do the import for three languages, Dutch, English and Spanish. As you might know, WPML is a &#8216;monster&#8217;, but still the best tool to make an overall translation of all content &#8216;elements&#8217; in a WordPress website, including WooCommerce. WPML is not friendly at all from a back-end developing perspective. It became a tool where all kinds of &#8216;modules&#8217; have been &#8216;glued to&#8217; the base of WPML. Translating is not as straighforward as you might think. Translating a menu has a different approach compared to translating a Gravity Form, or translating Themer templates.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">All plug-ins worked pretty well together<\/h3>\n\n\n\n<p>We started the whole project without using WPML, so initally &#8216;just&#8217; in Dutch, especially to test the &#8216;products import&#8217;. We made the decision to import all records everytime after changing were being applied in the Access database. So untouched records were -re-imported, changed records were updates and new records were added to the products catalogue within WooCommerce.<\/p>\n\n\n\n<p>Beaver Themer, WooCommerce and WPML (and needed add-ons) all worked very well together for all tasks needed now and to be expected tasks, once a real multilingual webshop will be needed.<\/p>\n\n\n\n<p>Also the CSV import of three language based product catalogues worked well. Only disadvantage was that all three language versions could not be imported at one. We had to do separate badges.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">WooCommerce more structured<\/h3>\n\n\n\n<p>The <a rel=\"noreferrer noopener\" href=\"https:\/\/wordpress.org\/plugins\/woocommerce\/\" target=\"_blank\">latest version<\/a> of WooCommerce (starting at 4.0) was improved a lot after Automattic took the plug-in in their portfolio. The community was not very satisfied after Automattic took over, since they changed a lot about their paid add-on policy, just to make more money. But still, WooCommerce is the &#8216;unwritten&#8217; standard for a webshop in WordPress environments.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">The workflow<\/h3>\n\n\n\n<p>We did setup the following worklow. We will limit describing the workflow from the moment we started the project from the &#8216;building phase&#8217;.<\/p>\n\n\n\n<blockquote class=\"wp-block-quote is-layout-flow wp-block-quote-is-layout-flow\"><p>Part of Technical design<\/p><\/blockquote>\n\n\n\n<p><strong>The plug-ins we needed:<\/strong><\/p>\n\n\n\n<ul class=\"wp-block-list\"><li>Beaver Builder (obviously&#8230;&#8230;)<\/li><li>Beaver Themer (to create WooCommerce based templates for archive pages, category pages and products pages)<\/li><li>PowerPack add-on (especially for WooCommerce category based slider)<\/li><li>Gravity Forms<\/li><li>WooCommerce<\/li><li>WPML and the 4 free add-ons Woocommerce Multilingual, Gravity Forms Multilingual, WPML String Translation and WPML Translation Management<\/li><li>The rest of the most obvious plug-ins for any site like SEO and (internal) Search optimization (we will not discuss them here in detail)<\/li><\/ul>\n\n\n\n<p><strong>The pages we created<\/strong><\/p>\n\n\n\n<ul class=\"wp-block-list\"><li>Homepage (also the base for the WooCommerce shop)<\/li><li>3 &#8216;just pages&#8217; for background information purposes and contact (not connected to a Beaver Themer template)<\/li><\/ul>\n\n\n\n<p>We left the pages created by WooCommerce in the pages list, but for the current requested functionallity, those pages are not used. So, for example, the <strong>account page<\/strong>, the <strong>shopping basket<\/strong> page and the <strong>payment<\/strong> page are left untouched for the moment.<\/p>\n\n\n\n<p><strong>The 9 templates we created:<\/strong><\/p>\n\n\n\n<ul class=\"wp-block-list\"><li>Homepage template with the category slider from PowerPack<\/li><li>6 individual category templates<\/li><li>Header template<\/li><li>An archive template for all products view<\/li><\/ul>\n\n\n\n<p><strong>The menu:<\/strong><\/p>\n\n\n\n<ul class=\"wp-block-list\"><li>Homepage<\/li><li>The collections, with 3 of the 6 categories<\/li><li>Extra pieces, with 3 of the 6 categories<\/li><li>Info, with 3 pages<\/li><\/ul>\n\n\n\n<h3 class=\"wp-block-heading\">The functional templates set-up overview<\/h3>\n\n\n\n<p>The header template is a global template for the whole site and makes logo and menu fit on desktop, tablets and mobiles. Setup is straight forward. The menu items shown for each language, have been translated within WPML. A &#8216;country flag&#8217; area has been added to the right of th emenu to chosse the requested language&#8217;. WPML takes care of that, so no action required in the menu setup itself.<\/p>\n\n\n\n<div class=\"wp-block-image\"><figure class=\"aligncenter size-large\"><a href=\"https:\/\/www.nieuwsmarkt.nl\/wp-content\/uploads\/2020\/06\/image.png\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"576\" src=\"https:\/\/www.nieuwsmarkt.nl\/wp-content\/uploads\/2020\/06\/image-1024x576.png\" alt=\"\" class=\"wp-image-4320\" srcset=\"https:\/\/www.nieuwsmarkt.nl\/wp-content\/uploads\/2020\/06\/image-1024x576.png 1024w, https:\/\/www.nieuwsmarkt.nl\/wp-content\/uploads\/2020\/06\/image-300x169.png 300w, https:\/\/www.nieuwsmarkt.nl\/wp-content\/uploads\/2020\/06\/image-768x432.png 768w, https:\/\/www.nieuwsmarkt.nl\/wp-content\/uploads\/2020\/06\/image-1536x864.png 1536w, https:\/\/www.nieuwsmarkt.nl\/wp-content\/uploads\/2020\/06\/image.png 1920w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/a><figcaption>fig. 1. basic setup of the homepage<\/figcaption><\/figure><\/div>\n\n\n\n<div class=\"wp-block-image\"><figure class=\"aligncenter size-large\"><a href=\"https:\/\/www.nieuwsmarkt.nl\/wp-content\/uploads\/2020\/06\/image-1.png\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"576\" src=\"https:\/\/www.nieuwsmarkt.nl\/wp-content\/uploads\/2020\/06\/image-1-1024x576.png\" alt=\"\" class=\"wp-image-4330\" srcset=\"https:\/\/www.nieuwsmarkt.nl\/wp-content\/uploads\/2020\/06\/image-1-1024x576.png 1024w, https:\/\/www.nieuwsmarkt.nl\/wp-content\/uploads\/2020\/06\/image-1-300x169.png 300w, https:\/\/www.nieuwsmarkt.nl\/wp-content\/uploads\/2020\/06\/image-1-768x432.png 768w, https:\/\/www.nieuwsmarkt.nl\/wp-content\/uploads\/2020\/06\/image-1-1536x864.png 1536w, https:\/\/www.nieuwsmarkt.nl\/wp-content\/uploads\/2020\/06\/image-1.png 1920w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/a><figcaption>fig. 2. basic setup for each category (collection) overview page<\/figcaption><\/figure><\/div>\n\n\n\n<figure class=\"wp-block-image size-large\"><a href=\"https:\/\/www.nieuwsmarkt.nl\/wp-content\/uploads\/2020\/06\/image-2.png\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"576\" src=\"https:\/\/www.nieuwsmarkt.nl\/wp-content\/uploads\/2020\/06\/image-2-1024x576.png\" alt=\"\" class=\"wp-image-4347\" srcset=\"https:\/\/www.nieuwsmarkt.nl\/wp-content\/uploads\/2020\/06\/image-2-1024x576.png 1024w, https:\/\/www.nieuwsmarkt.nl\/wp-content\/uploads\/2020\/06\/image-2-300x169.png 300w, https:\/\/www.nieuwsmarkt.nl\/wp-content\/uploads\/2020\/06\/image-2-768x432.png 768w, https:\/\/www.nieuwsmarkt.nl\/wp-content\/uploads\/2020\/06\/image-2-1536x864.png 1536w, https:\/\/www.nieuwsmarkt.nl\/wp-content\/uploads\/2020\/06\/image-2.png 1920w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/a><figcaption>fig. 3. Individual product pages by template<\/figcaption><\/figure>\n\n\n\n<h3 class=\"wp-block-heading\">Importing data<\/h3>\n\n\n\n<p>The Whole setup with all data was created in Access, whcih exports a CSV that can be imported in WooCommerce. A fiel\/column connection setup is required to make the import work as needed. The best way was to export a set of manually insterted products form WooCommerce to see what data details will be supplied and can be used to do the import from a well formatted CSV from Access.<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><a href=\"https:\/\/www.nieuwsmarkt.nl\/wp-content\/uploads\/2020\/06\/image-3.png\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"576\" src=\"https:\/\/www.nieuwsmarkt.nl\/wp-content\/uploads\/2020\/06\/image-3-1024x576.png\" alt=\"\" class=\"wp-image-4384\" srcset=\"https:\/\/www.nieuwsmarkt.nl\/wp-content\/uploads\/2020\/06\/image-3-1024x576.png 1024w, https:\/\/www.nieuwsmarkt.nl\/wp-content\/uploads\/2020\/06\/image-3-300x169.png 300w, https:\/\/www.nieuwsmarkt.nl\/wp-content\/uploads\/2020\/06\/image-3-768x432.png 768w, https:\/\/www.nieuwsmarkt.nl\/wp-content\/uploads\/2020\/06\/image-3-1536x864.png 1536w, https:\/\/www.nieuwsmarkt.nl\/wp-content\/uploads\/2020\/06\/image-3.png 1920w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/a><figcaption>fig. 4. The fields in the required CSV format for WooCommerce<\/figcaption><\/figure>\n\n\n\n<p><strong>The basis WooCommerce fields setup:<\/strong><\/p>\n\n\n\n<ul class=\"wp-block-list\"><li>ID<\/li><li>Product name<\/li><li>Short desciption<\/li><li>Description (text area with HTML markup for SEO (h3) and lists etc.)<\/li><li>Category<\/li><li>Images (first is featured image URL , all other (comma separated URL&#8217;s get into the gallery) (*)<\/li><\/ul>\n\n\n\n<p>In this case no (extra) custom fields were required to add more specific functionality. WooCommerce offers for the kind of products in this case, enought possibilities to get the job done.<\/p>\n\n\n\n<p><em>(*) to overwrite existing images, we switched off the &#8216;month\/week&#8217; upload hierarchy for uploading media, so all images will be uploaded in the root of &#8216;uploads&#8217; in the wp-content folder.<\/em><\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Some little scripts added to functions.php<\/h3>\n\n\n\n<p>Around images, there were some little extra requirements:<\/p>\n\n\n\n<ul class=\"wp-block-list\"><li>The removal of the &#8216;olympus&#8217; name during import of images comning from an olympus camera. Alt, title, caption and subscription, were filled with &#8216;olympus digital camera&#8217;.<\/li><li>The insertion of a &#8216;made clean&#8217; filename for the same fields as mentioned above. For exampke &#8216;LindaMar_nl__Oorbellen_Vin01_OZ.jpg&#8217;, shoudl become &#8216;Lindamar Nl Oorbellen Vin01 Oz&#8217;.<\/li><\/ul>\n\n\n\n<p>For the first one, we found a <a rel=\"noreferrer noopener\" href=\"https:\/\/wordpress.org\/plugins\/remove-olympus-digital-camera-from-caption-and-title-by-image-upload\/\" target=\"_blank\">little plug-in<\/a> called &#8216;Remove &#8216;OLYMPUS DIGITAL CAMERA&#8217; from caption and title by image upload&#8217;. We used just some of the code and inserted this <a rel=\"noreferrer noopener\" href=\"https:\/\/brutalbusiness.com\/automatically-set-the-wordpress-image-title-alt-text-other-meta\/\" target=\"_blank\">in the code from<\/a> Francisco Ruis from Br\u00fctal Business. So importing images result in a consistent combination of filename, Alt, title, caption and subscription. Although no captions were used in the project.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Translations needed<\/h3>\n\n\n\n<p>After the inititial test setup in Dutch, including a working import, the next step was to make the site multilingual.<\/p>\n\n\n\n<p><strong>Translations were needed for:<\/strong><\/p>\n\n\n\n<ul class=\"wp-block-list\"><li>All &#8216;static&#8217; pages<\/li><li>All products and the connected fields<\/li><li>All categories (names and description)<\/li><li>All Themer templates<\/li><li>All menu items<\/li><\/ul>\n\n\n\n<p><em>We made translations for <strong>all<\/strong> content templates to be used in another languages to be as flexible as possible. For example for specific language dependend content later (localized offers might be a valid reason).<\/em><\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Conclusions<\/h3>\n\n\n\n<p>The workflow defined above describes the process for a future perspective of reading back the way things were done and how things could evolve in the near future. Have a look at the <a href=\"https:\/\/lindamar.nl\/\" target=\"_blank\" rel=\"noreferrer noopener\">website<\/a>, which is still in progress.<\/p>","protected":false},"excerpt":{"rendered":"<p>Een webshop maken, die bij aanvang nog geen betaalfuncties hoeft te te hebben in een meertalige omgeving, is best een uitdaging. Aangevuld met de wens dat alle artikelen vanuit een .csv bestand worden ge\u00efmporteerd.<\/p>","protected":false},"author":1,"featured_media":4398,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[4],"tags":[],"class_list":["post-4275","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-review"],"_links":{"self":[{"href":"https:\/\/www.nieuwsmarkt.nl\/nl\/wp-json\/wp\/v2\/posts\/4275","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.nieuwsmarkt.nl\/nl\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.nieuwsmarkt.nl\/nl\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.nieuwsmarkt.nl\/nl\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.nieuwsmarkt.nl\/nl\/wp-json\/wp\/v2\/comments?post=4275"}],"version-history":[{"count":3,"href":"https:\/\/www.nieuwsmarkt.nl\/nl\/wp-json\/wp\/v2\/posts\/4275\/revisions"}],"predecessor-version":[{"id":4441,"href":"https:\/\/www.nieuwsmarkt.nl\/nl\/wp-json\/wp\/v2\/posts\/4275\/revisions\/4441"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.nieuwsmarkt.nl\/nl\/wp-json\/wp\/v2\/media\/4398"}],"wp:attachment":[{"href":"https:\/\/www.nieuwsmarkt.nl\/nl\/wp-json\/wp\/v2\/media?parent=4275"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.nieuwsmarkt.nl\/nl\/wp-json\/wp\/v2\/categories?post=4275"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.nieuwsmarkt.nl\/nl\/wp-json\/wp\/v2\/tags?post=4275"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}