Skip to content

Instantly share code, notes, and snippets.

@jimbojsb
Created March 26, 2014 03:18
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jimbojsb/9776400 to your computer and use it in GitHub Desktop.
Save jimbojsb/9776400 to your computer and use it in GitHub Desktop.
<?php
public function getActionText()
{
session_start();
if($this->coupon_image) {
$action = 'view coupon';
} else if($this->in_store) {
if($this->product_deal) {
$action = 'get deal';
} else {
$action = 'view coupon';
}
} else if($this->hasCoupon()) {
if($_SESSION['button-test'] == 1) {
$action = 'get code';
} else {
$action = 'reveal code';
}
} else if($this->isFree() && $this->format == Offers_Model_Offer::FORMAT_PROMO) {
$action = 'get offer';
} else if($this->isDeal()) {
if($_SESSION['button-test'] == 2) {
$action = 'score deal';
} else {
$action = 'get deal';
}
} else if ($this->action) {
//OFR-13358
$action = $this->action;
} else if ($this->format == Offers_Model_Offer::FORMAT_PROMO) {
if($_SESSION['button-test'] == 3) {
$action = 'get savings';
} else {
$action = 'apply savings';
}
} else {
$action = 'get offer';
}
return ucwords(strtolower($action));
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment