This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Step 3 (Final Step): Initialize configurators after $w is ready | |
$w.onReady(function () { | |
// referencing the _options and _databases in Step 1 | |
new ProductConfigurators(_options, _databases); | |
}); | |
// All set! |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Step 2: Add in ProductConfigurators class | |
class ProductConfigurators { | |
constructor (options, databases) { | |
this.options = options.map(v => { | |
return { | |
...v, | |
overlay: $w(v.overlay), | |
title: $w(v.title), | |
repeater: $w(v.repeater) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Step 1: Specify the IDs of the components on your dynamic product page | |
const _options = [ | |
// Three sets of options | |
{ | |
overlay: '#image2', | |
title: '#text14', | |
repeater: '#repeater1', | |
button: '#button1', | |
buttonImage: '#image5' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Step 1: Specify the IDs of the components on your dynamic product page | |
const _options = [ | |
// Three sets of options | |
{ | |
overlay: '#image2', | |
title: '#text14', | |
repeater: '#repeater1', | |
button: '#button1', | |
buttonImage: '#image5' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import xml.etree.ElementTree as ET | |
import json | |
# configuration: change filename and namespace if needed | |
xml_name = './data.xml' | |
out_name = r'data.json' | |
ns = { | |
'wp': 'http://wordpress.org/export/1.2/', | |
'excerpt': 'http://wordpress.org/export/1.2/excerpt/', |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package your.package.name; | |
import android.support.v7.app.AppCompatActivity; | |
import android.os.Bundle; | |
import android.view.View; | |
import android.widget.TextView; | |
public class MainActivity extends AppCompatActivity { | |
// Global variable for quantity | |
... |