-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.php
More file actions
77 lines (65 loc) · 2.01 KB
/
index.php
File metadata and controls
77 lines (65 loc) · 2.01 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
<?php
use App\product;
include 'vendor/autoload.php';
//product::$url = '/product2/';
$p = (new \App\product( '123', new \App\Attributes(
[ 'name' => '100% Cotton T-Shirt',
'dean',
'live' => 1,
'new' => 1,
'specificationDescription' => 'This is the short Desc...',
'FeatureDescription' => 'This item will fit in a space...',
'shortDescription' => 'Spec text...',
'LongDescription' => 'This is the long description',
'deliveryTime' => 2,
'VideoUrl' => 'https://youtu.be/CPBJgpK0Ulc'
]
)));
$p->setAttribute( 'name', new \App\Attribute('Cotton Tees') );
$v1 = (new \App\generalProductVariation('v1', new \App\Attributes(
[
'name' => 'Small',
'colour' => 'red',
'cost' => 5.80,
'price' => 8.75,
'specialPriceActiveDate' => '01/01/17',
'specialPriceEndDate' => '29/12/17',
'specialPriceActive' => 1,
'specialPrice' => 8.00,
'barcode' => '801123487',
'depth' => 30,
'height' => 20,
'length' => 20,
'width' => 50,
'weight' => 100
]
)))
->addImage(
(new \App\productImage())
->setName('top.twenty.black.box.jpg'))
->addImage(
(new \App\productImage())
->setName('34_17-box.jpg'));
$v2 = (new \App\generalProductVariation('v2', new \App\Attributes(
[
'name' => 'Medium',
'cost' => 5.80,
'price' => 8.75,
'barcode' => '801123487',
'depth' => 30,
'height' => 20,
'length' => 20,
'width' => 50,
'weight' => 100
]
)))
->addImage(
(new \App\productImage())
->setName('top.twenty.black.box.jpg'))
->addImage(
(new \App\productImage())
->setName('34_17-box.jpg'));
$p->addVariation($v1)
->addVariation($v2);
dump($p);
dump(product::$url . $p->getShortName());