Share with SMS contacts as only customer referral option on mobile #5092

This commit is contained in:
Pererinha 2015-04-06 16:00:48 -03:00
parent 56b5cca91c
commit eda4ec88d5
9 changed files with 19 additions and 14 deletions

View File

@ -392,7 +392,7 @@ class Controller_api_Giftcard extends Crunchbutton_Controller_Rest {
if( $reward->checkIfItIsEligibleForFirstTimeOrder() && $valid ){ if( $reward->checkIfItIsEligibleForFirstTimeOrder() && $valid ){
$value = $reward->getReferredDiscountAmount(); $value = $reward->getReferredDiscountAmount();
if( $value ){ if( $value ){
echo json_encode( [ 'success' => [ 'value' => $value, 'giftcard' => $code, 'message' => 'You have a $' . $value . ' gift card towards your first order.' ] ] ); echo json_encode( [ 'success' => [ 'value' => $value, 'giftcard' => $code, 'message' => 'You have a $' . $value . ' gift card for a free delivery.' ] ] );
exit; exit;
} }
} }

View File

@ -28,7 +28,7 @@
</div> </div>
<br /> <br />
<div> <div ng-if="account.user.points.away_free_delivery > 0">
<p> <p>
You are <b>{{account.user.points.away_free_delivery}}</b> points away from a free delivery!<br> You are <b>{{account.user.points.away_free_delivery}}</b> points away from a free delivery!<br>
</p> </p>

View File

@ -45,7 +45,7 @@
Congrats, you just got a <b>${{giftcard.value}}</b> gift card. Congrats, you just got a <b>${{giftcard.value}}</b> gift card.
</div> </div>
<br/> <br/>
Go ahead and order something delicious! Go ahead and order some food!
</div> </div>
<div class="bottom-links"> <div class="bottom-links">
<span class="giftcard-later" ng-click="modal.close();">Great</span> <span class="giftcard-later" ng-click="modal.close();">Great</span>

View File

@ -43,7 +43,7 @@
<br/><br/> <br/><br/>
<p> <p>
You are <b>{{account.user.points.away_free_delivery}}</b> points away from a free delivery.<br> You are <b>{{account.user.points.away_free_delivery}}</b> points away from a <strong>free delivery</strong>.<br>
Earn points by ordering food, sharing your order, or referring friends.<br> Earn points by ordering food, sharing your order, or referring friends.<br>
Get your friends to enter your code {{account.user.invite_code}} in the Notes section of their first order, and they will get $3 off and you a delivery free ;) Get your friends to enter your code {{account.user.invite_code}} in the Notes section of their first order, and they will get $3 off and you a delivery free ;)
<br> <br>

View File

@ -7,7 +7,7 @@
<div ng-show="account.user.invite_code"> <div ng-show="account.user.invite_code">
<p> <p>
Get your friends to enter <b>your referal code</b> in the Notes section of their first order, and they will get $3 off and you a delivery free ;) Get your friends to enter <b>your referral code</b> in the Notes section of their first order, and they will get $3 off and you a delivery free ;)
</p><br/> </p><br/>
</div> </div>

View File

@ -37,7 +37,12 @@
You just got a <b>${{giftcard.value}}</b> gift card to <b class="pointer" ng-click="giftcard.openRestaurant();">{{modal.restaurant.name}}</b>. You just got a <b>${{giftcard.value}}</b> gift card to <b class="pointer" ng-click="giftcard.openRestaurant();">{{modal.restaurant.name}}</b>.
</span> </span>
<span ng-show="!modal.restaurant"> <span ng-show="!modal.restaurant">
<div ng-if="giftcard.message">
{{giftcard.message}}
</div>
<div ng-if="!giftcard.message">
You just got a <b>${{giftcard.value}}</b> gift card. You just got a <b>${{giftcard.value}}</b> gift card.
</div>
</span> </span>
&nbsp;Go ahead and order some food! &nbsp;Go ahead and order some food!

View File

@ -61,7 +61,7 @@
<br/> <br/>
<p class="delivery-free"> <p class="delivery-free">
You just earned <strong>{{order.reward.points}}</strong> points! You just earned <strong>{{order.reward.points}}</strong> points!
<span></span>You are <strong>{{account.user.points.away_free_delivery}}</strong> points away from a free delivery. <span ng-if="account.user.points.away_free_delivery > 0"> You are <strong>{{account.user.points.away_free_delivery}}</strong> points away from a free delivery.</span>
</p> </p>
<br/><br/> <br/><br/>
</div> </div>

View File

@ -7,7 +7,7 @@
<a id="credit"></a> <a id="credit"></a>
<div ng-show="!account.user.points.free_delivery_message && account.user.points.away_free_delivery"> <div ng-show="!account.user.points.free_delivery_message && account.user.points.away_free_delivery">
<p><span class="delivery-free">You are <b>{{account.user.points.away_free_delivery || 0}}</b> points away</span> <br><br> from a free delivery. Earn points by ordering food, sharing your order, or referring friends.</p><br/> <p><span class="delivery-free">You are <b>{{account.user.points.away_free_delivery || 0}}</b> points away from a <strong>free delivery</strong>. Earn points by ordering food, sharing your order, or referring friends.</span></p><br/>
</div> </div>
<div ng-show="account.user.points.free_delivery_message && account.user.points.free_delivery"> <div ng-show="account.user.points.free_delivery_message && account.user.points.free_delivery">
<p><span class="delivery-free">You have <b>{{account.user.points.free_delivery}}</b> points!</span> <br><br>The next delivery fee is on us.</p> <p><span class="delivery-free">You have <b>{{account.user.points.free_delivery}}</b> points!</span> <br><br>The next delivery fee is on us.</p>
@ -19,7 +19,7 @@
<div ng-show="account.user.invite_code" class="hide-mobile"> <div ng-show="account.user.invite_code" class="hide-mobile">
<p> <p>
Get your friends to enter <b>your referal code</b> in the Notes section of their first order, and they will get $3 off and you a delivery free ;) Get your friends to enter <b>your referral code</b> in the Notes section of their first order, and they will get $3 off and you a delivery free ;)
</p> </p>
<br><br> <br><br>
</div> </div>

View File

@ -28,12 +28,12 @@ NGApp.factory( 'ReferralService', function( $http, $rootScope, $location, Accoun
} }
service.sms = function(){ service.sms = function(){
var text = 'i love crunchbutton delivery :) use my code ' + service.invite_code + ' in the Notes section and get $3 off your 1st order!'; var text = 'I love crunchbutton delivery :) use my code ' + service.invite_code + ' in the Notes section and get your first order delivered for free!';
if( App.iOS() ){ if( App.iOS() ){
return 'sms:&body=' + text + ' ' + service.invite_url; return 'sms:body=' + text + ' ' + service.invite_url;
} else { } else {
// this appears to be the standard and should work for other non droid phones // this appears to be the standard and should work for other non droid phones
return 'sms:?body=' + text + ' ' + service.invite_url; return 'sms:body=' + text + ' ' + service.invite_url;
} }
} }