public function embed_product($atts) { // Attributes $shortcode_atts = shortcode_atts(array('product' => '', 'image_size' => '', 'style' => '', 'text_color' => '', 'button_background' => '', 'button_text_color' => '', 'background_color' => '', 'border_color' => '', 'border_padding' => '', 'button_text' => '', 'destination' => '', 'money_format' => ''), $atts); $settings = get_option('shopify', array()); foreach ($shortcode_atts as $key => $value) { if ($value != "") { $settings[$key] = $value; } } if (!isset($settings['product'])) { return "product is a required attribute of the shopify shortcode"; } if (empty($settings['myshopify_domain'])) { return "<span style='color: red'>Please enter your myshopify domain in the shopify settings page</span>"; } return Shopify_Widget::generate($settings); }
} ?> "> <div id="shopify-getting-started" class="updated header-notice" style="display: none;"> <h3>Let's get started!</h3> <p>Read our <a href='http://en.support.wordpress.com/shopify/' target="_blank">step-by-step guide</a> on how to embed your Shopify store’s products into your WordPress blog.</p> <p><a href="#" onclick="Shopify.hideTip()" class="button" >Dismiss</a></p> </div> <form id="shopify-settings-form" method="post" action="options.php"> <?php settings_fields($this->option_group); ?> <?php do_settings_sections($this->menu_slug); ?> <?php submit_button('Save settings', 'primary', 'save-shopify-settings'); ?> </form> <div id="shopify-widget-preview"> <h3>Preview of embedded product</h3> <?php $sample_settings = array_merge($settings, array('product' => 'http://wordpress-demo.myshopify.com/products/test', 'myshopify_domain' => 'wordpress-demo.myshopify.com')); echo Shopify_Widget::generate($sample_settings); ?> </div> </div> </div>