资源说明:Profile module
```
Create a block with name `view_orders` and code:
```php
= open_form() ?>
if(!$orders->count): ?>
endif ?>
= close_form() ?>
```
To navigate it all you could use a sidebar partial with this code (note: it uses `/account` for the URL, and `.page .wrap` for the page wrapper element):
```php
# ls-module-profile Provides customer profiles for your store. ## Installation 1. Download [Profile](https://github.com/limewheel/ls-module-profile/zipball/master) 1. Create a folder named `profile` in the `modules` directory. 1. Extract all files into the `modules/profile` directory (`modules/profile/readme.md` should exist). 1. Setup your code as described in the `Usage` section. 1. Done! ## Links * [Marketplace](https://lemonstandapp.com/marketplace/module/profile/) * [Discussion](http://forum.lemonstandapp.com/topic/2267-module-profile/) * [Source](https://github.com/limewheel/ls-module-profile) ## Example Create an account in the [Utility theme](http://themes.lemonstandapp.com/utility/), and navigate to the top-right My Account area. ## Usage The usage code is only applicable to the jQuery frontend JavaScript library. You will need to take considerations to convert to MooTools. Create a `Profile` page. For your content, use something like this: ```php extract(array_merge(array( 'partial_step' => post('partial_step', false), 'section' => post('section', 'change_information') //defaults to the change_information section ), $params)); ?> if($partial_step) { $this->render_block($section); return; } ?> $this->render_block($section) ?> ``` Go to the `Head & Blocks` tab. Create a block with name `change_account` and code: ```php= open_form() ?> = close_form() ?>= open_form() ?> ``` Create a block with name `change_information` and code: ```php $billing_info = Shop_CheckoutData::get_billing_info(); $billing_countries = Shop_Country::get_list($billing_info->country); $billing_country = $billing_info->country ? $billing_info->country : $billing_countries[0]->id; $billing_states = Shop_CountryState::create(true)->where('country_id=?', $billing_country)->order('name')->find_all(); ?>
= close_form() ?>= open_form(array('id' => 'billing_info')) ?> Billing Information
= close_form() ?>= open_form(array('id' => 'shipping_info')) ?> = close_form() ?> ``` Create a block with name `change_password` and code: ```php= open_form() ?> ``` Create a block with name `change_shipping` and code: ```php $shipping_info = Shop_CheckoutData::get_shipping_info(); $shipping_countries = Shop_Country::get_list($shipping_info->country); $shipping_country = $shipping_info->country ? $shipping_info->country : $shipping_countries[0]->id; $shipping_states = Shop_CountryState::create(true)->where('country_id=?', $shipping_country)->order('name')->find_all(); ?>Save = close_form() ?>
Shipping Information copy billing
No orders yet.
else: ?>Click an order for details.
# | Date | Status | Total | |
---|---|---|---|---|
= $order->id ?> | = $order->order_datetime->format('%x') ?> | = h($order->status->name) ?> since = $order->status_update_datetime->format('%x') ?> | = format_currency($order->total) ?> |
My Account
```
本源码包内暂不包含可直接显示的源代码文件,请下载源码包。