pub struct ProductVariationCreateBuilder { /* private fields */ }Implementations§
source§impl ProductVariationCreateBuilder
impl ProductVariationCreateBuilder
sourcepub fn description(&mut self, description: impl Into<String>) -> &mut Self
pub fn description(&mut self, description: impl Into<String>) -> &mut Self
Variation description.
sourcepub fn regular_price(&mut self, regular_price: impl Into<String>) -> &mut Self
pub fn regular_price(&mut self, regular_price: impl Into<String>) -> &mut Self
Variation regular price.
sourcepub fn sale_price(&mut self, sale_price: impl Into<String>) -> &mut Self
pub fn sale_price(&mut self, sale_price: impl Into<String>) -> &mut Self
Variation sale price.
sourcepub fn date_on_sale_from(
&mut self,
year: i32,
month: u32,
day: u32
) -> &mut Self
pub fn date_on_sale_from( &mut self, year: i32, month: u32, day: u32 ) -> &mut Self
Start date of sale price, in the site’s timezone.
sourcepub fn date_on_sale_to(&mut self, year: i32, month: u32, day: u32) -> &mut Self
pub fn date_on_sale_to(&mut self, year: i32, month: u32, day: u32) -> &mut Self
End date of sale price, in the site’s timezone.
sourcepub fn status(&mut self, status: ProductStatus) -> &mut Self
pub fn status(&mut self, status: ProductStatus) -> &mut Self
Variation status. Options: draft, pending, private and publish. Default is publish.
sourcepub fn is_virtual(&mut self) -> &mut Self
pub fn is_virtual(&mut self) -> &mut Self
If the variation is virtual. Default is false.
sourcepub fn downloadable(&mut self) -> &mut Self
pub fn downloadable(&mut self) -> &mut Self
If the variation is downloadable. Default is false.
sourcepub fn downloads(&mut self, file_src: impl Into<String>) -> &mut Self
pub fn downloads(&mut self, file_src: impl Into<String>) -> &mut Self
List of downloadable files.
sourcepub fn download_limit(&mut self, download_limit: i32) -> &mut Self
pub fn download_limit(&mut self, download_limit: i32) -> &mut Self
Number of times downloadable files can be downloaded after purchase. Default is -1.
sourcepub fn download_expiry(&mut self, download_expiry: i32) -> &mut Self
pub fn download_expiry(&mut self, download_expiry: i32) -> &mut Self
Number of days until access to downloadable files expires. Default is -1.
sourcepub fn tax_status(&mut self, tax_status: TaxStatus) -> &mut Self
pub fn tax_status(&mut self, tax_status: TaxStatus) -> &mut Self
Tax status. Options: taxable, shipping and none. Default is taxable.
sourcepub fn manage_stock(&mut self) -> &mut Self
pub fn manage_stock(&mut self) -> &mut Self
Stock management at variation level. Default is false.
sourcepub fn stock_quantity(&mut self, stock_quantity: i32) -> &mut Self
pub fn stock_quantity(&mut self, stock_quantity: i32) -> &mut Self
Stock quantity.
sourcepub fn stock_status(&mut self, stock_status: StockStatus) -> &mut Self
pub fn stock_status(&mut self, stock_status: StockStatus) -> &mut Self
Controls the stock status of the product. Options: instock, outofstock, onbackorder. Default is instock.
sourcepub fn backorders(&mut self, backorders: BackordersStatus) -> &mut Self
pub fn backorders(&mut self, backorders: BackordersStatus) -> &mut Self
If managing stock, this controls if backorders are allowed. Options: no, notify and yes. Default is no.
sourcepub fn dimensions(
&mut self,
length: impl Into<String>,
width: impl Into<String>,
height: impl Into<String>
) -> &mut Self
pub fn dimensions( &mut self, length: impl Into<String>, width: impl Into<String>, height: impl Into<String> ) -> &mut Self
Variation dimensions. See Product variation - Dimensions properties
sourcepub fn shipping_class(&mut self, shipping_class: impl Into<String>) -> &mut Self
pub fn shipping_class(&mut self, shipping_class: impl Into<String>) -> &mut Self
Shipping class slug.
sourcepub fn attributes(
&mut self,
id: Option<i32>,
name: impl Into<String>,
option: impl Into<String>
) -> &mut Self
pub fn attributes( &mut self, id: Option<i32>, name: impl Into<String>, option: impl Into<String> ) -> &mut Self
List of attributes.
Menu order, used to custom sort products.
sourcepub fn meta_data(
&mut self,
key: impl Into<String>,
value: impl Serialize
) -> &mut Self
pub fn meta_data( &mut self, key: impl Into<String>, value: impl Serialize ) -> &mut Self
Meta data.