File tree Expand file tree Collapse file tree 1 file changed +17
-1
lines changed
Expand file tree Collapse file tree 1 file changed +17
-1
lines changed Original file line number Diff line number Diff line change 11<?php
22global $ post ;
33
4- $ articles = array ( Aplazame_Aplazame_Api_BusinessModel_Article::createFromProduct ( new WC_Product ( $ post ) ) );
4+ $ articles = array ();
5+ $ product = wc_get_product ( $ post );
6+
7+ switch ( WC_Aplazame::_m_or_a ( $ product , 'get_type ' , 'product_type ' ) ) {
8+ case 'variable ' :
9+ $ children_ids = $ product ->get_children ();
10+
11+ foreach ( $ children_ids as $ child_id ) {
12+ $ child = wc_get_product ( $ child_id );
13+ $ articles [] = Aplazame_Aplazame_Api_BusinessModel_Article::createFromProduct ( $ child );
14+ }
15+ break ;
16+
17+ default :
18+ $ articles [] = Aplazame_Aplazame_Api_BusinessModel_Article::createFromProduct ( $ product );
19+ }
20+
521?>
622
723<div id="aplazame_campaigns_tab" class="panel woocommerce_options_panel">
You can’t perform that action at this time.
0 commit comments