Warning: chmod(): Operation not permitted in /var/www/hopeinstoughton_www/wp-content/plugins/simple-universal-google-analytics/main.php on line 8 [0] in function chmod in /var/www/hopeinstoughton_www/wp-content/plugins/simple-universal-google-analytics/main.php on line 8 [1] in function include_once in /var/www/hopeinstoughton_www/wp-settings.php on line 560 [2] in function require_once in /var/www/hopeinstoughton_www/wp-config.php on line 85 [3] in function require_once in /var/www/hopeinstoughton_www/wp-load.php on line 50 [4] in function require_once in /var/www/hopeinstoughton_www/wp-blog-header.php on line 13 [5] in function require in /var/www/hopeinstoughton_www/index.php on line 17
| Server IP : 94.177.8.99 / Your IP : 216.73.217.165 Web Server : Apache/2.4.58 (Ubuntu) System : Linux aries 6.8.0-134-generic #134-Ubuntu SMP PREEMPT_DYNAMIC Fri Jun 26 18:43:11 UTC 2026 x86_64 User : www-data ( 33) PHP Version : 8.1.34 Disable Function : NONE MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : OFF | Sudo : ON | Pkexec : OFF Directory : /var/www/theyoungdesigners_com/modules/storeTyd/view/ |
Upload File : |
<?php
class TYD_View extends View {
public function UpdateHTML(&$html, $needle, $replacement) {
$needle = "<!-- [{$needle}] -->";
if (($pos = strpos($html, $needle)) === FALSE) {
die("Unable to locate $needle in html");
}
$html = substr($html, 0, $pos) . $replacement . substr($html, $pos);
}
public function Column2Text() {
return <<<'BLOCK'
{{#if opt_tyd}}
<div><em>Next Step: Select {{opt_tyd}}</em></div>
{{/if}}
BLOCK;
}
public function Column7Text() {
return <<<'BLOCK'
{{#ifeq type "components"}}
<div class="tyd-colors">
<div class="description-text text-style-body-lg-400" style="line-height:1.6">Your Chosen Colors</div>
<div class="tyd-list">
{{{custom}}}
</div>
</div>
{{/ifeq}}
BLOCK;
}
public function storetyd_option() {
$base = $this->StaticUriModule(dirname(__DIR__));
$this->IncludeFile("$base/jquery.simplecolorpicker.css");
$this->IncludeFile("$base/jquery.simplecolorpicker.js", 'simpcolorpick')->depends('jquery');
$this->IncludeFile("$base/tyd.js")->depends('simpcolorpick');
$html = <<<'BLOCK'
<h3>{{page_title}}</h3>
<p>This product contains {{num}} rose heads with {{length}}" stems. Change the color of any
rose head by clicking on it.</p>
<div class="rose-container" ajax="{{ajax}}">
{{#each list_lines}}
<div class="rose-line">
{{#each item}}
<div class="rose-item" id="rose_{{num}}">
<div class="rose-background bind-rose" style="background-image:url({{rose}});"><img src="{{@root/border}}"></div>
<div class="rose-footer">
<select name="color_{{num}}" class="bind-simplecolorpicker">{{#each @root/list_swatch}}
<option value="{{key}}"{{#ifeq key ../swatch}} selected{{/ifeq}}>{{value}}</option>
{{/each}}</select>
<a href="{{uri}}" class="cart-link" target="product">{{title}}</a>
</div>
</div>
{{/each}}
</div>
{{/each}}
</div>
<div>
<label><input class="action-tyd-deet" type="checkbox" name="details" value="1"> Show product links</label>
<p>The colors of products illustrated on this page are not accurate. A better representation can be found on the individual product pages</p>
</div>
<div style="text-align:right;margin-right:40px">
{{#if flag_edit}}
<div style="margin-top: 20px;width:200px;display:inline-block">
<a class="c-button c-button-normal c-button-lg c-button-block c-button-icon c-button-icon-leading action-addcart" href="/account/order/{{ordernum}}/edit" style="padding:0 8px;margin-bottom:8px;margin-left:0px">
Back to Order
</a>
</div>
{{else}}
<div style="margin-top: 20px;width:200px;display:inline-block">
<a class="c-button c-button-secondary c-button-lg c-button-block c-button-icon c-button-icon-leading action-addcart" href="/" style="padding:0 8px;margin-bottom:8px;margin-left:0px">
Continue Shopping
</a>
</div>
<div style="margin-top: 20px;width:200px;display:inline-block;margin-left:20px">
<a class="c-button c-button-primary c-button-lg c-button-block c-button-icon c-button-icon-leading action-addcart" href="/store/cart" style="padding:0 8px;margin-bottom:8px;margin-left:0px">
View Shopping Cart
</a>
</div>
{{/if}}
</div>
BLOCK;
$this('storetyd_option')->html($html)->Title('Color Selection');
}
public function Column2Customize($full = TRUE) {
if ($full == 'edit') {
return <<<'BLOCK'
{{#if opt_tyd}}<div style="padding-bottom:15px;"><strong>Color Selection:</strong> {{{tyd_description}}}</div>{{/if}}
BLOCK;
} elseif ($full) {
return <<<'BLOCK'
{{#if opt_tyd}}<div style="padding-bottom:15px;">Chosen colors: <strong>{{tyd_description}}</strong> [<a class="link_custom" href="/store/color-selection/{{custom}}">Change</a>]</div>{{/if}}
BLOCK;
} else {
return <<<'BLOCK'
{{#if opt_tyd}}<div style="padding-bottom:15px;"><strong>{{{tyd_description}}}</strong></div>{{/if}}
BLOCK;
}
}
public function storetyd_contact() {
$macro = hook_execute('component.add', '', 'formedit');
$button = hook_execute_late('html.button', '', 'Send Request', '', 'cc-blue');
$html = <<<BLOCK
<div class="indented">
<h3 class="templateheader">{{page_title}}</h3>
<div>
<strong>{{coname}}</strong><br>
Phone: <a href="tel:+{{safephone}}">{{cophone}}</a> (tollfree, USA or Canada)<br>
Email: <a href="mailto:{{coemail}}">{{coemail}}</a>
</div>
<br>
<form class="frm json" method="post">
$macro
<div class="form-actions right">
<a class="submit" href="#">$button</a>
</div>
<br /><br />
</form>
</div>
BLOCK;
$this('storetyd_contact')->html($html)->Title('Contact Us');
}
function storetyd_packingslip() {
return <<<'BLOCK'
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<style type="text/css">
body {
font-family: Arial;
}
.footer-container,
.header2-container,
.total-container,
.header-container {
display: table;
width: 100%;
max-width: 1000px;
margin-bottom: 20px;
}
.total-container .column,
.table-container .column,
.header2-container .column,
.header-container .column {
display: table-cell;
vertical-align: top;
}
.footer-container .column {
display: table-cell;
vertical-align: middle;
}
.header-container .column1 {
font-size: 32px;
color: #000;
}
.header-container .column2 {
width: 300px;
text-align: right;
font-size: 32px;
color: #003962;
font-weight: bold;
}
body.sandbox .header-container .column2 {
color: #c00;
}
body.sandbox .header2-container .column3 .strike {
text-decoration: line-through;
}
.header2-container .column1 {
width: 250px;
}
.header2-container .column3 {
width: 300px;
text-align: right;
}
.hilited {
background-color: #003962;
color: #fff;
padding: 4px 10px;
margin: 5px 0;
}
.header2-container .address {
padding: 4px 10px;
margin: 5px 0;
line-height: 1.2;
}
.header2-container .item-row {
padding: 4px 0px;
}
.header2-container .item-key {
display: inline-block;
width: 150px;
text-align: left;
}
.header2-container .item-value {
display: inline-block;
width: 150px;
text-align: right;
}
.table-container {
display: table;
width: 100%;
max-width: 1000px;
}
.total-container .column1,
.table-container .column1 {
width: 100px;
text-align: left;
}
.total-container .column3,
.table-container .column3 {
width: 80px;
text-align: right;
}
.total-container .column2 {
text-align: right;
}
.body-container > div.table-container:nth-child(even) {
background-color: #ececec;
}
.body-container .table-container .column {
border-left: 1px solid #cccccc;
padding: 3px 10px;
}
.body-container .table-container .column3 {
border-right: 1px solid #cccccc;
}
.body-container > div.table-container:last-child {
border-bottom: 1px solid #cccccc;
}
.total-container {
margin-top: 10px;
}
.total-container .column {
padding: 3px 10px;
}
.total-container .column2 {
font-size: 12px;
font-weight: bold;
}
.footer-container {
margin-top: 20px;
text-align: center;
font-size: 12px;
}
.footer-container .column1.qrcode {
width: calc(100% - 98px);
}
.footer-container .message {
font-size: 14px;
font-weight: bold;
}
.footer-container img {
width: 93px;
}
</style>
</head>
<body{{#if flag_test}} class="sandbox"{{/if}}>
<div class="header-container">
<div class="column column1"><img src="{{tradingname}}" style="width:342px;height:42px"></div>
<div class="column column2">{{#if flag_test}}Test Packing Slip{{else}}Packing Slip{{/if}}</div>
</div>
<div class="header2-container">
<div class="column column1">
<div class="hilited">Ship To:</div>
<div class="address">{{#with address}}
{{name}}<br>
{{del_a}}<br>
{{#ifeq addr2 ""}}{{else}}{{addr2}}<br>{{/ifeq}}
{{town}}, {{state}} {{zip}}<br>
{{country_name}}
{{/with}}</div>
</div>
<div class="column column2">
</div>
<div class="column column3">
<div class="item-row"><span class="item-key">Order Number:</span><span class="item-value">{{ordernum}}</span></div>
<div class="item-row"><span class="item-key">Order Date:</span><span class="item-value">{{orderdate}}</span></div>
<div class="item-row"><span class="item-key">Carrier:</span><span class="item-value strike">{{carrier_abbr}}</span></div>
<div class="item-row strike">{{carrier_service}}</div>
</div>
</div>
<div class="table-container">
<div class="column column1 hilited">SKU #</div>
<div class="column column2 hilited">Description</div>
<div class="column column3 hilited">Quantity</div>
</div>
<div class="body-container">
{{#each tableline}}
<div class="table-container">
<div class="column column1">{{sku}}</div>
<div class="column column2">{{#if html}}{{{html}}}{{else}}{{desc}}{{/if}}</div>
<div class="column column3">{{qty}}</div>
</div>
{{/each}}
</div>
<div class="total-container">
<div class="column column1"> </div>
<div class="column column2">Total Quantity</div>
<div class="column column3">{{total_qty}}</div>
</div>
<br>
<div class="footer-container">
<div class="column column1{{#if qrcode}} qrcode{{/if}}">
<div class="message">Thank you for your business!</div>
<div>Should you have any enquiries concerning this packing slip or your goods, please contact us.</div>
<div> </div>
<div>Tel: {{cophone}} // E-mail: {{coemail}} // Web: {{hostname}}</div>
</div>
{{#if qrcode}}
<div class="column column2"><img src="{{qrcode}}"></div>
{{/if}}
</div>
</body>
</html>
BLOCK;
$html = hook_execute('template.store.report.COL2', $html); // show customization
return $html;
}
public function template_request_email() {
$body = <<<BLOCK
Name: {{name}}<br>
Email: {{email}}<br>
Phone: {{phone}}<br>
<br>
Message:
<pre>{{message}}</pre>
BLOCK;
$css = <<<BLOCK
.right {
text-align: right;
}
.bold {
font-weight: bold;
}
BLOCK;
return [
'title' => 'Website Request',
'subject' => 'Website Request',
'body' => $body,
'css' => $css,
];
}
// if the customization is suitable, show a button to change customization
// auth contains store_order_detail record id
public function store_customization_edit2() {
$html = <<<BLOCK
{{#if button_customize}}
<div>
<span class="a-button a-button-normal a-spacing-mini a-button-base">
<span class="a-button-inner"><a href="/account/order/{{@root/ordernum}}/customize?auth={{auth}}" class="a-button-text json-request" role="button">Change {{button_customize}}</a></span>
</span>
</div>
{{/if}}
BLOCK;
return $html;
}
}