Skip to content

Commit

Permalink
Added a config file for affiliates to be used in the iframes in order…
Browse files Browse the repository at this point in the history
… to be passed on to Shopify
  • Loading branch information
Xavier Tô committed Apr 20, 2016
1 parent d046a62 commit 107c5d8
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 2 deletions.
4 changes: 4 additions & 0 deletions affiliate_config.php
@@ -0,0 +1,4 @@
<?php
// set your affiliate code here i.e. awesome-partner
define('AFFILIATE_CODE', '');
?>
2 changes: 1 addition & 1 deletion includes/class-modal.php
Expand Up @@ -31,7 +31,7 @@ public function __construct( $plugin ) {
* @return string HTML markup of modal.
*/
public function get_modal() {
$iframe_url = 'https://widgets.shopifyapps.com/embed_admin/embeds/picker';
$iframe_url = 'https://widgets.shopifyapps.com/embed_admin/embeds/picker?ref='.AFFILIATE_CODE;

$site = get_option( 'secp-connected-site', false );
if ( $site ) {
Expand Down
3 changes: 2 additions & 1 deletion includes/class-settings.php
Expand Up @@ -107,8 +107,9 @@ public function add_options_page() {
* @since 1.0.0
*/
public function admin_page_display() {
$settings_url = "https://widgets.shopifyapps.com/embed_admin/settings?ref=".AFFILIATE_CODE;
?>
<iframe class="secp-settings-iframe" src="https://widgets.shopifyapps.com/embed_admin/settings"></iframe>
<iframe class="secp-settings-iframe" src="<?php echo esc_url( $settings_url ); ?>"></iframe>
<?php
}
}
1 change: 1 addition & 0 deletions shopify-ecommerce-shopping-cart.php
@@ -1,4 +1,5 @@
<?php
include_once("affiliate_config.php");
/**
* Plugin Name: Shopify eCommerce Plugin - Shopping Cart
* Plugin URI: https://www.shopify.com/buy-button
Expand Down

0 comments on commit 107c5d8

Please sign in to comment.