Re: Snap Affiliates v2.0 for v1.5.0 and later
Ouch, that's not very pretty! My current plan for this display issue is, for any commissions that were manually-overridden, to display a (*) next to the commission amount and include a note below the commissions-paid table that reads:
Code:
(*) This commission value was modified by the store owner based on a change to the order.
Any suggestions/improvements would be greatly appreciated!
** Update **
Perhaps the right solution is a combination of mvstudio's posting (showing both calculated and paid) along with a notation when they're different to let the customer know that the store knows that they're different?
Re: Snap Affiliates v2.0 for v1.5.0 and later
Ouch, that's not very pretty! LOL! oookkkk!!!! :huh:
What we did was add the coding that was needed to display the extra column using the original files provided, nothing more. My apologies for asking the how to, without taking a look at the files first. I thought it could solve the problem for somebody else, looking for the same thing, so that's why I shared. Any extras or styling is up to the store owner, I think. We didn't like the original layout of the page, so ours was customized to match our stores, and we took all those divisions out and replaced them for tables instead. We also added a note to the page that explains the reason for any discrepancy in commissions as established in our Terms, which is what you were referring to.
This is what ours tpl_referrer_main_default.php page looks like
https://www.byvalenti.com/images/snapaffiliate1.jpg
For anyone looking to style the page like ours here is the code for the tpl_referrer_main_default.php
HTML Code:
<?php
// +----------------------------------------------------------------------+
// |Snap Affiliates for Zen Cart |
// +----------------------------------------------------------------------+
// | Copyright (c) 2013, Vinos de Frutas Tropicales (lat9) for ZC 1.5.0+ |
// | |
// | Original: Copyright (c) 2009 Michael Burke |
// | http://www.filterswept.com |
// | |
// +----------------------------------------------------------------------+
// | This source file is subject to version 2.0 of the GPL license. |
// +----------------------------------------------------------------------+
?>
<div class="centerColumn" id="referrerMainDefault">
<h1 id="affiliateMain"><?php echo HEADING_TITLE; ?></h1>
<?php
if ($messageStack->size('referrer_main') > 0) echo $messageStack->output('referrer_main'); /*v2.4.0-a*/
if (!$is_logged_in) {
?>
<p id="refMainNeedLogin"><?php echo sprintf(TEXT_PLEASE_LOGIN, zen_href_link(FILENAME_LOGIN, '', 'SSL')); ?></p>
<?php
} else {
if (!$submitted) {
?>
<p id="refMainNotSubmitted"><?php echo sprintf(TEXT_REFERRER_SIGNUP, zen_href_link(FILENAME_REFERRER_SIGNUP, '', 'SSL')); ?></p>
<?php
} else {
if (!$approved) {
?>
<p><?php echo TEXT_REFERRAL_SUBMITTED; ?></p>
<?php
} else {
if ($banned) {
?>
<p><?php echo sprintf(TEXT_REFERRAL_BANNED, zen_href_link(FILENAME_CONTACT_US, '', 'NONSSL')); ?></p>
<?php
} else {
echo zen_draw_form('referral_main', zen_href_link(FILENAME_REFERRER_MAIN, '', 'SSL'), 'get', ''); /*v2.4.0-c*/
?>
<input type="hidden" name="main_page" value="<?php echo FILENAME_REFERRER_MAIN; ?>" />
<div id="refSignupLinks">
<h3><?php echo TEXT_ORDERS_PAYMENTS; ?> | <a href="<?php echo zen_href_link(FILENAME_REFERRER_TOOLS, '', 'SSL');?>"><?php echo TEXT_MARKETING_TOOLS; ?></a> | <a href="<?php echo zen_href_link(FILENAME_REFERRER_SIGNUP, 'terms', 'SSL');?>"><?php echo TEXT_REFERRER_TERMS; ?></a></h3>
</div>
<hr />
<h3><?php echo HEADING_REFERRER_INFO; ?></h3>
<div id="referrerMainInfo" class="table">
<div class="item_outer">
<div class="item c1"><?php echo TEXT_REFERRER_ID; ?></div>
<div class="item c2"><?php echo $referrer->fields['referrer_key']; ?></div>
</div>
<?php //-bof-v2.2.0a ?>
<div class="item_outer">
<div class="item c1"><?php echo TEXT_MY_WEBSITE; ?></div>
<div class="item c2"><?php echo $referrer->fields['referrer_homepage'] . '<br /><a href="' . /*-bof-c-v2.4.0*/ zen_href_link(FILENAME_REFERRER_EDIT, '', 'SSL') /*-eof-c-v2.4.0*/ . '">' . zen_image_button(BUTTON_IMAGE_EDIT_SMALL, BUTTON_EDIT_SMALL_ALT) . '</a> '; ?></div>
</div>
<?php //-eof-v2.2.0a ?>
<div class="item_outer">
<div class="item c1"><?php echo TEXT_LAST_PAYMENT_MADE; ?></div>
<div class="item c2"><?php echo ($last_payout == 0) ? TEXT_NO_PAYMENTS : date("F j, Y", $last_payout); /*v2.5.0c*/ ?></div>
</div>
<div class="item_outer">
<div class="item c1"><?php echo TEXT_COMMISSION_RATE; ?></div>
<div class="item c2"><?php printf("%u%%", 100 * $referrer->fields['referrer_commission']); ?></div>
</div>
</div>
<br />
<hr />
<h3><?php echo TEXT_SALES_SUMMARY; ?></h3>
<div id="referrerMainSummary" class="table">
<div class="item_outer">
<div class="item c1"><?php echo TEXT_CURRENT_SALES; ?></div>
<div class="item c2"><?php echo $currencies->format($unpaid_total); ?></div>
</div>
<div class="item_outer">
<div class="item c1"><?php echo TEXT_UNPAID_COMMISSION; ?></div>
<div class="item c2"><?php echo $currencies->format($unpaid_commission, 2); ?></div>
</div>
<div class="item_outer">
<div class="item c1"><?php echo TEXT_YTD_SALES; ?></div>
<div class="item c2"><?php echo $currencies->format($yearly_total, 2); ?></div>
</div>
<div class="item_outer">
<div class="item c1"><?php echo TEXT_YTD_COMMISSION; ?></div>
<div class="item c2"><?php echo $currencies->format($yearly_commission, 2); ?></div>
</div>
</div>
<br />
<hr />
<h3 class="back"><?php echo TEXT_ACTIVITY; ?></h3>
<div class="forward" style="margin-top: 12px;">
<?php echo TEXT_FROM; ?>
<input type="hidden" name="start" value="<?php echo $activity_begin; ?>" />
<select onchange="document.referral_main.start.value = this.options[this.selectedIndex].value; document.referral_main.submit();">
<?php
$begin = getdate($activity_begin);
$end = getdate($activity_end);
$today = getdate();
$bound = ( $begin['year'] == $today['year'] ) ? $today['mon'] : 12;
for( $i = 1; $i <= $bound; ++$i ) {
printf('<option value="%u"%s>%s</option>' . "\n", mktime(0, 0, 0, $i, 1, $begin['year']), ($i == $begin['mon']) ? ' selected="selected"' : '', date ('F', mktime(0,0,0, $i)));
}
?>
</select>
<select onchange="document.referral_main.start.value = this.options[this.selectedIndex].value; document.referral_main.submit();">
<?php
for ($i = $today['year'] - 9; $i <= $today['year']; $i++) {
printf('<option value="%u"%s>%s</option>' ."\n", mktime(0, 0, 0, $begin['mon'], 1, $i), (($i == $begin['year']) ? ' selected="selected"' : ''), date( "Y", mktime(0,0,0, $begin['mon'], 1, $i)));
}
?>
</select>
<?php echo TEXT_TO; ?>
<input type="hidden" name="end" value="<?php echo $activity_end; ?>" />
<select onchange="document.referral_main.end.value = this.options[this.selectedIndex].value; document.referral_main.submit();">
<?php
$bound = ( $end['year'] == $today['year'] ) ? $today['mon'] : 12;
for( $i = 1; $i <= $bound; ++$i ) {
printf('<option value="%u"%s>%s</option>' . "\n", mktime(0, 0, 0, $i + 1, 0, $end['year']), (($i == $end['mon']) ? ' selected="selected"' : ''), date('F', mktime(0,0,0, $i)));
}
?>
</select>
<select onchange="document.referral_main.end.value = this.options[this.selectedIndex].value; document.referral_main.submit();">
<?php
for( $i = $begin['year']; $i <= $today['year']; ++$i) {
printf('<option value="%u"%s>%s</option>' . "\n", mktime(0, 0, 0, $end['mon'] + 1, 0, $i), (($i == $end['year'] ) ? ' selected="selected"' : ''), date('Y', mktime(0,0,0, $end['mon'] + 1, 0, $i)));
}
?>
</select>
</div>
<br class="clearBoth" />
<br class="clearBoth" />
<table style="width: 100%">
<tr>
<td class="thead c1" style="width:16.6%;"><?php echo HEADING_PURCHASE_DATE; ?></td>
<td class="thead c1" style="width:16.6%;"><?php echo HEADING_AMOUNT; ?></td>
<td class="thead c1" style="width:16.6%;"><?php echo HEADING_COMMISSION_RATE; ?></td>
<td class="thead c1" style="width:16.6%;"><?php echo HEADING_AMOUNT_COMMISSION; ?></td>
<td class="thead c1" style="width:16.6%;"><?php echo HEADING_COMMISSION; ?></td>
<td class="thead c1" style="width:16.7%;"><?php echo HEADING_COMMISSION_PAY_DATE; ?></td>
</tr>
<?php
$toggle = false;
foreach ($activity as $entry) {
$nice_date = ($entry['paid'] == 0) ? TEXT_UNPAID : date('F j, Y', $entry['paid']); /*v2.5.0c*/
?>
<tr class="item_outer <?php echo ($toggle) ? 'odd' : 'even'; ?>">
<td class="item c1a"><?php echo date('F j, Y', $entry['date']); ?></td>
<td class="item c2"><?php echo $currencies->format($entry['amount']); ?></td>
<td class="item c3"><?php echo number_format($entry['commission'] * 100, 0) . '%'; ?></td>
<td class="item c4"><?php echo $currencies->format($entry['commission'] * $entry['amount']); ?></td>
<td class="item c4"><?php echo $currencies->format($entry['commission_paid_amount']); ?></td>
<td class="item c5"><?php echo $nice_date; ?></td>
</tr>
<?php
$toggle = !$toggle;
}
?>
<tr class="item_outer totals">
<td class="item c1"><?php echo HEADING_TOTALS; ?></td>
<td class="item c2"><?php echo $currencies->format($activity_total); ?></td>
<td class="item c3"><?php echo ' '; ?></td>
<td class="item c4"><?php echo $currencies->format($activity_commission); ?></td>
<td class="item c4"><?php echo $currencies->format($activity_commission_paid_amount); ?></td>
<td class="item c5"><?php echo ' '; ?></td>
</tr>
</table>
</form>
<br class="clearBoth" />
<p><?php echo TEXT_COMMISSION_PAID; ?></p>
<br class="clearBoth" />
<div class="buttonRow back"><?php echo zen_back_link() . zen_image_button(BUTTON_IMAGE_BACK, BUTTON_BACK_ALT) . '</a>'; ?></div>
<br class="clearBoth" />
<?php
} // Signed in, submitted, approved and not banned
} // Signed in, submitted but not approved
if (!$approved || $banned) {
?>
<div class="buttonRow back"><?php echo zen_back_link() . zen_image_button(BUTTON_IMAGE_BACK, BUTTON_BACK_ALT) . '</a>'; ?></div>
<?php
}
} // Signed in but not submitted
} // Signed in
?>
</div>
On the language>english>YOUR TEMPLATE>referrer_main.php:
Replace:
HTML Code:
define('HEADING_COMMISSION', 'Commission');
For:
HTML Code:
define('HEADING_COMMISSION', '*Commission Total');
And Add:
HTML Code:
define('TEXT_COMMISSION_PAID', '<strong>*Commission Total</strong> amounts, include any refunds or returns that have being deducted from the final commission amount. For more information on how
commissions are calculated please visit our <a href="index.php?main_page=referrer_signup&terms">Affiliate Terms & Conditions".');
Hope this is a little bit better =)
Re: Snap Affiliates v2.0 for v1.5.0 and later
My ouch! was on the plugin's current output, not your suggested changes!:shocking:
I'll incorporate your changes into the next version of SNAP ... thanks for the share.
Re: Snap Affiliates v2.0 for v1.5.0 and later
I've submitted v2.7.2 to the Plugins; it will be available for download one reviewed:
BUGFIX: Previously missing /images/referrers directory now included
BUGFIX: Correct processing on referrers_main page (make a distinction between calculated and paid commissions).
Thanks (again) to mvstudio for the report and the suggested correction!
Re: Snap Affiliates v2.0 for v1.5.0 and later
LOL!! got it! :D
Glad I was able to help! :smile:
Re: Snap Affiliates v2.0 for v1.5.0 and later
v2.7.2 is now available for download in the Plugins ...
Re: Snap Affiliates v2.0 for v1.5.0 and later
Great Plug-in. I'm trying to add multiple banners in the same size but different color variations. I'm not sure how I should name them. I have one of each size uploaded and working, however I want to add a blue version, magenta version, etc of the same size. I tried naming them "ref.160.600.blue.png" and entered 160,600,blue,png/ in Admin... but its not working.
Any help or suggestions appreciated.
Re: Snap Affiliates v2.0 for v1.5.0 and later
Also, where can I enter the image alt text???
Re: Snap Affiliates v2.0 for v1.5.0 and later
Quote:
Originally Posted by
georgiepants
Great Plug-in. I'm trying to add multiple banners in the same size but different color variations. I'm not sure how I should name them. I have one of each size uploaded and working, however I want to add a blue version, magenta version, etc of the same size. I tried naming them "ref.160.600.blue.png" and entered 160,600,blue,png/ in Admin... but its not working.
Any help or suggestions appreciated.
The plugin doesn't currently support multiple images of the same size. That feature is on its "wishlist".
Re: Snap Affiliates v2.0 for v1.5.0 and later
Quote:
Originally Posted by
georgiepants
Also, where can I enter the image alt text???
There is currently no provision to enter an individual image's custom alt-text, but the common text currently used is the TEXT_IMAGE_ALT_TEXT constant defined in /includes/languages/english/YOUR_TEMPLATE/referrers_tools.php.