PageSourceSearch

https://bc-wordpress-reference.vercel.app/_next/static/chunks/page…/CLI/Import_Products-e279ec83143ee461.js

js bc-wordpress-reference.vercel.app collected 2026-10-03 06:12:04 UTC 13,702 bytes, 1 lines download raw bytes

1(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[83282],{61536:(s,i,e)=>{(window.__NEXT_P=window.__NEXT_P||[]).push(["/Classes/BigCommerce/CLI/Import_Products",function(){return e(26784)}])},26784:(s,i,e)=>{"use strict";e.r(i),e.d(i,{default:()=>l,useTOC:()=>t});var n=e(74848),r=e(27849),h=e(40272),d=e(71355);function t(s){return[{value:"Methods",id:"methods",depth:2},{value:"command",id:"command",depth:3},{value:"description",id:"description",depth:3},{value:"arguments",id:"arguments",depth:3},{value:"run",id:"run",depth:3},{value:"Inherited methods",id:"inherited-methods",depth:2},{value:"register",id:"register",depth:3},{value:"command",id:"command-1",depth:3},{value:"description",id:"description-1",depth:3},{value:"arguments",id:"arguments-1",depth:3},{value:"run",id:"run-1",depth:3}]}let l=(0,r.e)(function(s){let{toc:i=t(s)}=s,e={a:"a",blockquote:"blockquote",code:"code",h1:"h1",h2:"h2",h3:"h3",hr:"hr",li:"li",p:"p",pre:"pre",span:"span",strong:"strong",table:"table",tbody:"tbody",td:"td",th:"th",thead:"thead",tr:"tr",ul:"ul",...(0,d.R)(),...s.components};return(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(e.hr,{}),"\n",(0,n.jsx)(e.h1,{children:"Import_Products"}),"\n",(0,n.jsx)(e.p,{children:"Handles the import process for products from BigCommerce."}),"\n",(0,n.jsx)(e.p,{children:"This class defines a WP-CLI command to import products from a connected BigCommerce store. It provides functionality for full or partial imports, the option to force a refresh of products, and hooks for tracking the progress of the import. Additionally, it manages logging for the import process and allows for managing product data through various stages of the import."}),"\n",(0,n.jsxs)(e.ul,{children:["\n",(0,n.jsxs)(e.li,{children:["Full name: ",(0,n.jsx)(e.code,{children:"\\BigCommerce\\CLI\\Import_Products"})]}),"\n",(0,n.jsxs)(e.li,{children:["Parent class: ",(0,n.jsx)(e.a,{href:"./classes/BigCommerce/CLI/Command",children:(0,n.jsx)(e.code,{children:"\\BigCommerce\\CLI\\Command"})})]}),"\n"]}),"\n",(0,n.jsx)(e.h2,{id:i[0].id,children:i[0].value}),"\n",(0,n.jsx)(e.h3,{id:i[1].id,children:i[1].value}),"\n",(0,n.jsx)(e.p,{children:"Declare command name"}),"\n",(0,n.jsx)(e.pre,{tabIndex:"0","data-language":"php","data-word-wrap":"",children:(0,n.jsx)(e.code,{children:(0,n.jsxs)(e.span,{children:[(0,n.jsx)(e.span,{style:{"--shiki-light":"#D73A49","--shiki-dark":"#F97583"},children:"protected"}),(0,n.jsx)(e.span,{style:{"--shiki-light":"#6F42C1","--shiki-dark":"#B392F0"},children:" command"}),(0,n.jsx)(e.span,{style:{"--shiki-light":"#24292E","--shiki-dark":"#E1E4E8"},children:"(): "}),(0,n.jsx)(e.span,{style:{"--shiki-light":"#D73A49","--shiki-dark":"#F97583"},children:"string"})]})})}),"\n",(0,n.jsx)(e.p,{children:(0,n.jsx)(e.strong,{children:"Return Value:"})}),"\n",(0,n.jsx)(e.p,{children:"The command name for importing products."}),"\n",(0,n.jsx)(e.hr,{}),"\n",(0,n.jsx)(e.h3,{id:i[2].id,children:i[2].value}),"\n",(0,n.jsx)(e.p,{children:"Add a command description"}),"\n",(0,n.jsx)(e.pre,{tabIndex:"0","data-language":"php","data-word-wrap":"",children:(0,n.jsx)(e.code,{children:(0,n.jsxs)(e.span,{children:[(0,n.jsx)(e.span,{style:{"--shiki-light":"#D73A49","--shiki-dark":"#F97583"},children:"protected"}),(0,n.jsx)(e.span,{style:{"--shiki-light":"#6F42C1","--shiki-dark":"#B392F0"},children:" description"}),(0,n.jsx)(e.span,{style:{"--shiki-light":"#24292E","--shiki-dark":"#E1E4E8"},children:"(): "}),(0,n.jsx)(e.span,{style:{"--shiki-light":"#D73A49","--shiki-dark":"#F97583"},children:"string|"}),(0,n.jsx)(e.span,{style:{"--shiki-light":"#005CC5","--shiki-dark":"#79B8FF"},children:"void"})]})})}),"\n",(0,n.jsx)(e.p,{children:(0,n.jsx)(e.strong,{children:"Return Value:"})}),"\n",(0,n.jsx)(e.p,{children:"A description of the import products command."}),"\n",(0,n.jsx)(e.hr,{}),"\n",(0,n.jsx)(e.h3,{id:i[3].id,children:i[3].value}),"\n",(0,n.jsx)(e.p,{children:"Declare command arguments"}),"\n",(0,n.jsx)(e.pre,{tabIndex:"0","data-language":"php","data-word-wrap":"",children:(0,n.jsx)(e.code,{children:(0,n.jsxs)(e.span,{children:[(0,n.jsx)(e.span,{style:{"--shiki-light":"#D73A49","--shiki-dark":"#F97583"},children:"protected"}),(0,n.jsx)(e.span,{style:{"--shiki-light":"#6F42C1","--shiki-dark":"#B392F0"},children:" arguments"}),(0,n.jsx)(e.span,{style:{"--shiki-light":"#24292E","--shiki-dark":"#E1E4E8"}
1,children:"(): "}),(0,n.jsx)(e.span,{style:{"--shiki-light":"#D73A49","--shiki-dark":"#F97583"},children:"array"}),(0,n.jsx)(e.span,{style:{"--shiki-light":"#24292E","--shiki-dark":"#E1E4E8"},children:"[]"})]})})}),"\n",(0,n.jsx)(e.p,{children:(0,n.jsx)(e.strong,{children:"Return Value:"})}),"\n",(0,n.jsx)(e.p,{children:"Command arguments for the import products command."}),"\n",(0,n.jsx)(e.hr,{}),"\n",(0,n.jsx)(e.h3,{id:i[4].id,children:i[4].value}),"\n",(0,n.jsx)(e.p,{children:"Execute the import process."}),"\n",(0,n.jsx)(e.pre,{tabIndex:"0","data-language":"php","data-word-wrap":"",children:(0,n.jsx)(e.code,{children:(0,n.jsxs)(e.span,{children:[(0,n.jsx)(e.span,{style:{"--shiki-light":"#D73A49","--shiki-dark":"#F97583"},children:"public"}),(0,n.jsx)(e.span,{style:{"--shiki-light":"#6F42C1","--shiki-dark":"#B392F0"},children:" run"}),(0,n.jsx)(e.span,{style:{"--shiki-light":"#24292E","--shiki-dark":"#E1E4E8"},children:"("}),(0,n.jsx)(e.span,{style:{"--shiki-light":"#D73A49","--shiki-dark":"#F97583"},children:"array"}),(0,n.jsx)(e.span,{style:{"--shiki-light":"#24292E","--shiki-dark":"#E1E4E8"},children:" $args, "}),(0,n.jsx)(e.span,{style:{"--shiki-light":"#D73A49","--shiki-dark":"#F97583"},children:"array"}),(0,n.jsx)(e.span,{style:{"--shiki-light":"#24292E","--shiki-dark":"#E1E4E8"},children:" $assoc_args): "}),(0,n.jsx)(e.span,{style:{"--shiki-light":"#005CC5","--shiki-dark":"#79B8FF"},children:"void"})]})})}),"\n",(0,n.jsx)(e.p,{children:(0,n.jsx)(e.strong,{children:"Parameters:"})}),"\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n",(0,n.jsxs)(e.table,{children:[(0,n.jsx)(e.thead,{children:(0,n.jsxs)(e.tr,{children:[(0,n.jsx)(e.th,{children:"Parameter"}),(0,n.jsx)(e.th,{children:"Type"}),(0,n.jsx)(e.th,{children:"Description"})]})}),(0,n.jsxs)(e.tbody,{children:[(0,n.jsxs)(e.tr,{children:[(0,n.jsx)(e.td,{children:(0,n.jsx)(e.code,{children:"$args"})}),(0,n.jsx)(e.td,{children:(0,n.jsx)(e.strong,{children:"array"})}),(0,n.jsx)(e.td,{children:"Arguments passed to the command."})]}),(0,n.jsxs)(e.tr,{children:[(0,n.jsx)(e.td,{children:(0,n.jsx)(e.code,{children:"$assoc_args"})}),(0,n.jsx)(e.td,{children:(0,n.jsx)(e.strong,{children:"array"})}),(0,n.jsx)(e.td,{children:"Associated arguments, such as flags."})]})]})]}),"\n",(0,n.jsx)(e.hr,{}),"\n",(0,n.jsx)(e.h2,{id:i[5].id,children:i[5].value}),"\n",(0,n.jsx)(e.h3,{id:i[6].id,children:i[6].value}),"\n",(0,n.jsx)(e.p,{children:"Register the command with WP-CLI."}),"\n",(0,n.jsx)(e.pre,{tabIndex:"0","data-language":"php","data-word-wrap":"",children:(0,n.jsx)(e.code,{children:(0,n.jsxs)(e.span,{children:[(0,n.jsx)(e.span,{style:{"--shiki-light":"#D73A49","--shiki-dark":"#F97583"},children:"public"}),(0,n.jsx)(e.span,{style:{"--shiki-light":"#6F42C1","--shiki-dark":"#B392F0"},children:" register"}),(0,n.jsx)(e.span,{style:{"--shiki-light":"#24292E","--shiki-dark":"#E1E4E8"},children:"(): "}),(0,n.jsx)(e.span,{style:{"--shiki-light":"#005CC5","--shiki-dark":"#79B8FF"},children:"void"})]})})}),"\n",(0,n.jsx)(e.p,{children:"This method checks if WP-CLI is defined and active. If so, it registers the command\nwith WP-CLI, using the specific command name defined in the child class."}),"\n",(0,n.jsx)(e.hr,{}),"\n",(0,n.jsx)(e.h3,{id:i[7].id,children:i[7].value}),"\n",(0,n.jsx)(e.p,{children:"Get the command name."}),"\n",(0,n.jsx)(e.pre,{tabIndex:"0","data-language":"php","data-word-wrap":"",children:(0,n.jsx)(e.code,{children:(0,n.jsxs)(e.span,{children:[(0,n.jsx)(e.span,{style:{"--shiki-light":"#D73A49","--shiki-dark":"#F97583"},children:"protected"}),(0,n.jsx)(e.span,{style:{"--shiki-light":"#6F42C1","--shiki-dark":"#B392F0"},children:" command"}),(0,n.jsx)(e.span,{style:{"--shiki-light":"#24292E","--shiki-dark":"#E1E4E8"},children:"(): "}),(0,n.jsx)(e.span,{style:{"--shiki-light":"#D73A49","--shiki-dark":"#F97583"},children:"string"})]})})}),"\n",(0,n.jsx)(e.p,{children:"This method must be implemented in the child class to return the specific command name."}),"\n",(0,n.jsxs)(e.ul,{children:["\n",(0,n.jsxs)(e.li,{children:["This method is ",(0,n.jsx)(e.strong,{children:"abstract"}),"."]}),"\n"]}),"\n",(0,n.jsx)(e.p,{children:(0,n.jsx)(e.strong,{children:"Return Value:"})}),"\n",(0,n.jsx)(e.p,{children:"The name of the WP-CLI command."}),"\n",(0,n.jsx)(e.hr,{}),"\n",(0,n.jsx)(e.h3,{id:i[8].id,children:i[8].value}),"\n",(0,n.jsx)(e.p,{children:"Get a short description of the command."}),"\n",(0,n.jsx)(e.pre,{tabIndex:"0","data-language":"php","data-word-wrap":"",children:(0,n.jsx)(e.code,{children:(0,n.jsxs)(e.span,{children:[(0,n.jsx)(e.span,{style:{"--shiki-light":"#D73A49","--shiki-dark":"#F97583"},children:"protected"}),(0,n.jsx)(e.span,{style:{"--shiki-light":"#6F42C1","--shiki-dark":"#B392F0"},children:" description"}),(0,n.jsx)(e.span,{style:{"--shiki-light":"#24292E","--shiki-dark":"#E1E4E8"}
1,children:"(): "}),(0,n.jsx)(e.span,{style:{"--shiki-light":"#D73A49","--shiki-dark":"#F97583"},children:"string"})]})})}),"\n",(0,n.jsx)(e.p,{children:"This method must be implemented in the child class to provide a brief description\nof the command’s functionality, which will be shown in the WP-CLI help output."}),"\n",(0,n.jsxs)(e.ul,{children:["\n",(0,n.jsxs)(e.li,{children:["This method is ",(0,n.jsx)(e.strong,{children:"abstract"}),"."]}),"\n"]}),"\n",(0,n.jsx)(e.p,{children:(0,n.jsx)(e.strong,{children:"Return Value:"})}),"\n",(0,n.jsx)(e.p,{children:"The short description of the command."}),"\n",(0,n.jsx)(e.hr,{}),"\n",(0,n.jsx)(e.h3,{id:i[9].id,children:i[9].value}),"\n",(0,n.jsx)(e.p,{children:"Get the command arguments."}),"\n",(0,n.jsx)(e.pre,{tabIndex:"0","data-language":"php","data-word-wrap":"",children:(0,n.jsx)(e.code,{children:(0,n.jsxs)(e.span,{children:[(0,n.jsx)(e.span,{style:{"--shiki-light":"#D73A49","--shiki-dark":"#F97583"},children:"protected"}),(0,n.jsx)(e.span,{style:{"--shiki-light":"#6F42C1","--shiki-dark":"#B392F0"},children:" arguments"}),(0,n.jsx)(e.span,{style:{"--shiki-light":"#24292E","--shiki-dark":"#E1E4E8"},children:"(): "}),(0,n.jsx)(e.span,{style:{"--shiki-light":"#D73A49","--shiki-dark":"#F97583"},children:"string"})]})})}),"\n",(0,n.jsx)(e.p,{children:"This method must be implemented in the child class to return the arguments\nrequired by the command. The arguments will be shown in the WP-CLI help output."}),"\n",(0,n.jsxs)(e.ul,{children:["\n",(0,n.jsxs)(e.li,{children:["This method is ",(0,n.jsx)(e.strong,{children:"abstract"}),"."]}),"\n"]}),"\n",(0,n.jsx)(e.p,{children:(0,n.jsx)(e.strong,{children:"Return Value:"})}),"\n",(0,n.jsx)(e.p,{children:"The arguments for the command."}),"\n",(0,n.jsx)(e.hr,{}),"\n",(0,n.jsx)(e.h3,{id:i[10].id,children:i[10].value}),"\n",(0,n.jsx)(e.p,{children:"Run the command."}),"\n",(0,n.jsx)(e.pre,{tabIndex:"0","data-language":"php","data-word-wrap":"",children:(0,n.jsx)(e.code,{children:(0,n.jsxs)(e.span,{children:[(0,n.jsx)(e.span,{style:{"--shiki-light":"#D73A49","--shiki-dark":"#F97583"},children:"public"}),(0,n.jsx)(e.span,{style:{"--shiki-light":"#6F42C1","--shiki-dark":"#B392F0"},children:" run"}),(0,n.jsx)(e.span,{style:{"--shiki-light":"#24292E","--shiki-dark":"#E1E4E8"},children:"("}),(0,n.jsx)(e.span,{style:{"--shiki-light":"#D73A49","--shiki-dark":"#F97583"},children:"array"}),(0,n.jsx)(e.span,{style:{"--shiki-light":"#24292E","--shiki-dark":"#E1E4E8"},children:" $args, "}),(0,n.jsx)(e.span,{style:{"--shiki-light":"#D73A49","--shiki-dark":"#F97583"},children:"array"}),(0,n.jsx)(e.span,{style:{"--shiki-light":"#24292E","--shiki-dark":"#E1E4E8"},children:" $assoc_args): "}),(0,n.jsx)(e.span,{style:{"--shiki-light":"#005CC5","--shiki-dark":"#79B8FF"},children:"void"})]})})}),"\n",(0,n.jsx)(e.p,{children:"This method must be implemented in the child class to define the logic\nfor executing the command. It accepts arguments and associative arguments\npassed to the command via WP-CLI."}),"\n",(0,n.jsxs)(e.ul,{children:["\n",(0,n.jsxs)(e.li,{children:["This method is ",(0,n.jsx)(e.strong,{children:"abstract"}),"."]}),"\n"]}),"\n",(0,n.jsx)(e.p,{children:(0,n.jsx)(e.strong,{children:"Parameters:"})}),"\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n",(0,n.jsxs)(e.table,{children:[(0,n.jsx)(e.thead,{children:(0,n.jsxs)(e.tr,{children:[(0,n.jsx)(e.th,{children:"Parameter"}),(0,n.jsx)(e.th,{children:"Type"}),(0,n.jsx)(e.th,{children:"Description"})]})}),(0,n.jsxs)(e.tbody,{children:[(0,n.jsxs)(e.tr,{children:[(0,n.jsx)(e.td,{children:(0,n.jsx)(e.code,{children:"$args"})}),(0,n.jsx)(e.td,{children:(0,n.jsx)(e.strong,{children:"array"})}),(0,n.jsx)(e.td,{children:"The positional arguments passed to the command."})]}),(0,n.jsxs)(e.tr,{children:[(0,n.jsx)(e.td,{children:(0,n.jsx)(e.code,{children:"$assoc_args"})}),(0,n.jsx)(e.td,{children:(0,n.jsx)(e.strong,{children:"array"})}),(0,n.jsx)(e.td,{children:"The associative arguments passed to the command."})]})]})]}),"\n",(0,n.jsx)(e.hr,{}),"\n",(0,n.jsx)(e.hr,{}),"\n",(0,n.jsxs)(e.blockquote,{children:["\n",(0,n.jsx)(e.p,{children:"Automatically generated on 2025-01-21"}),"\n"]})]})}
1,"/Classes/BigCommerce/CLI/Import_Products",{filePath:"pages/Classes/BigCommerce/CLI/Import_Products.md",timestamp:1737496368e3,pageMap:h.O,frontMatter:{},title:"Import_Products"},"undefined"==typeof RemoteContent?t:RemoteContent.useTOC)}},s=>{var i=i=>s(s.s=i);s.O(0,[27849,40272,90636,46593,38792],()=>i(61536)),_N_E=s.O()}]);

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.