当前位置: 首页>>代码示例>>PHP>>正文


PHP OrderItem::image方法代码示例

本文整理汇总了PHP中OrderItem::image方法的典型用法代码示例。如果您正苦于以下问题:PHP OrderItem::image方法的具体用法?PHP OrderItem::image怎么用?PHP OrderItem::image使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在OrderItem的用法示例。


在下文中一共展示了OrderItem::image方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: confirm

 function confirm()
 {
     //Generate a new basket item
     $Item = new OrderItem();
     $Basket = $this->_fetchBasket();
     $Title = array();
     foreach ($Basket['items'] as $Option) {
         if ($Option->type == 'Style') {
             $Item->image($Option->image);
         }
         $String = $Option->type . ': ' . $Option->title;
         if (isset($Option->variant)) {
             $String .= ' (' . $Option->variant . ')';
         }
         $Title[] = $String;
     }
     $Item->title('Custom Order');
     $Item->subtitle(implode($Title, ' & '));
     $Item->source('custom:' . substr(md5(time()), 0, 6));
     $Item->quantity(1);
     $Item->hidden(json_encode($this->basket));
     $Item->price($Basket['total']);
     $Item->addToOrder();
     $this->clear();
     redirect('/checkout/');
 }
开发者ID:Swift-Jr,项目名称:thmdhc,代码行数:26,代码来源:custom.php

示例2: fromOrderItem

 function fromOrderItem(OrderItem $Item)
 {
     $this->title = $Item->title();
     $this->subtitle = $Item->subtitle();
     $this->quantity = $Item->quantity();
     $this->hidden = $Item->hidden();
     $this->price = $Item->price();
     $this->image = $Item->image();
     list($Source, $ID) = $Item->source();
     if ($Source == 'shop') {
         $this->storeitem = $ID;
     }
 }
开发者ID:Swift-Jr,项目名称:thmdhc,代码行数:13,代码来源:mOrderItem.php

示例3: addtocart

 function addtocart($ProductID)
 {
     //Generate a new basket item
     $Item = new OrderItem();
     $Product = new mStoreItem($ProductID);
     $Item->title($Product->title);
     $Item->source('shop:' . $Product->id());
     $Item->subtitle($Product->description);
     $Item->quantity(1);
     $Item->image($Product->main_image()->filename);
     $Item->hidden(json_encode($Product->_data));
     $Item->price($Product->price);
     $Item->addToOrder();
     redirect('/checkout/');
 }
开发者ID:Swift-Jr,项目名称:thmdhc,代码行数:15,代码来源:shop.php


注:本文中的OrderItem::image方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。