Exemplo n.º 1
0
                                        <span class="glyphicon glyphicon-ok-sign text-success"></span>
                                    <?php 
        }
        ?>
                                    <input type="checkbox" <?php 
        echo $checked ? "checked" : '';
        ?>
 id="category_<?php 
        echo $rootCategory->entity_id;
        ?>
" name="category_ids[]" value="<?php 
        echo $rootCategory->entity_id;
        ?>
" />
                                    <span class="root-category"><?php 
        echo MigrateSteps::getMage1CategoryName($rootCategory->entity_id);
        ?>
( <?php 
        echo Yii::t('frontend', 'Root category');
        ?>
 )</span>
                                <?php 
        if ($categoryTree) {
            ?>
                                <ul>
                                    <?php 
            foreach ($categoryTree as $category) {
                ?>
                                        <li>
                                            <?php 
                if ($checked = in_array($category->entity_id, $migrated_category_ids)) {
 public static function getMG1Version()
 {
     $ver = NULL;
     $step = MigrateSteps::model()->findByPk(1);
     if ($step) {
         $settings = (object) json_decode($step->migrated_data);
         $ver = $settings->mg1_version;
     }
     return $ver;
 }
Exemplo n.º 3
0
                            <label for="customer_group_<?php 
        echo $group->customer_group_id;
        ?>
" class="checkbox-inline">
                                <input type="checkbox" <?php 
        echo $checked ? "checked" : '';
        ?>
 id="customer_group_<?php 
        echo $group->customer_group_id;
        ?>
" name="customer_group_ids[]" value="<?php 
        echo $group->customer_group_id;
        ?>
" />
                                <?php 
        echo $group->customer_group_code . " (" . MigrateSteps::getTotalCustomersByGroup($group->customer_group_id) . ")";
        ?>
                            </label>
                        </h4>
                    </li>
                    <?php 
    }
    ?>
                </ul>
                <?php 
}
?>
            </li>
        </ul>
    </div>
Exemplo n.º 4
0
        <div style="width: 45%;display: inline-block;">
            <h3><?php 
echo Yii::t('frontend', 'Magento 1.x');
?>
</h3>
            <div class="panel-group">
                <div class="panel panel-default">
                    <div class="panel-body">
                        <div class="form-group">
                            <label for="mg1-version"><?php 
echo Yii::t('frontend', 'Version');
?>
:</label>
                            <select class="form-control" id="mg1-version" name="mg1_version">
                                <?php 
$options = MigrateSteps::getMG1VersionOptions();
?>
                                <?php 
foreach ($options as $value => $label) {
    ?>
                                <option value="<?php 
    echo $value;
    ?>
" <?php 
    echo isset($settings->mg1_version) && $settings->mg1_version == $value ? 'selected="selected"' : '';
    ?>
><?php 
    echo $label;
    ?>
</option>
                                <?php 
Exemplo n.º 5
0
            <h3 class="list-group-item-heading">
                <?php 
if ($step->status == MigrateSteps::STATUS_DONE) {
    ?>
                    <span class="glyphicon glyphicon-ok-sign text-success"></span>
                <?php 
}
?>
                <?php 
echo Yii::t('frontend', 'Product Attributes');
?>
 (<?php 
echo Mage1Attribute::model()->count("entity_type_id = 4");
?>
 attributes. There are <?php 
echo MigrateSteps::getTotalVisibleProductsAttr();
?>
 attributes visible in back-end.)
            </h3>
        </li>
    </ul>

    <!--  Form Buttons-->
    <div class="step-controls">
        <?php 
if ($step->status == MigrateSteps::STATUS_NOT_DONE) {
    ?>
            <button type="submit" class="btn btn-primary"><?php 
    echo Yii::t('frontend', 'Start');
    ?>
</button>
Exemplo n.º 6
0
?>
"
         aria-valuemin="0" aria-valuemax="100" style="width:<?php 
echo $percent;
?>
%">
        <?php 
echo $percent;
?>
% Completed
    </div>
</div>

<div id="btn-reset">
    <?php 
if (MigrateSteps::model()->count("status =" . MigrateSteps::STATUS_DONE) > 0) {
    $class = "btn btn-danger";
} else {
    $class = "btn btn-danger disabled";
}
?>
    <a href="<?php 
echo Yii::app()->createUrl("migrate/resetAll");
?>
" title="<?php 
echo Yii::t('frontend', 'Click to reset all steps.');
?>
" class="<?php 
echo $class;
?>
"><span class="glyphicon glyphicon-refresh"></span> <?php 
 public function actionReset()
 {
     $stepIndex = Yii::app()->request->getParam('step', 1);
     $step = MigrateSteps::model()->findByPk($stepIndex);
     if ($step) {
         $dataPath = Yii::app()->basePath . DIRECTORY_SEPARATOR . "data" . DIRECTORY_SEPARATOR;
         $resetSQLFile = $dataPath . "step{$stepIndex}_reset.sql";
         if (file_exists($resetSQLFile)) {
             $rs = MigrateSteps::executeFile($resetSQLFile);
             if ($rs) {
                 if ($stepIndex == 4) {
                     //delete url related data in url_rewrite table and catalog_url_rewrite_product_category table
                     Mage2UrlRewrite::model()->deleteAll("entity_type = 'category'");
                 }
                 if ($stepIndex == 5) {
                     //delete url related data in url_rewrite table and catalog_url_rewrite_product_category table
                     Mage2UrlRewrite::model()->deleteAll("entity_type = 'product'");
                 }
                 //reset step status
                 $step->status = MigrateSteps::STATUS_NOT_DONE;
                 $step->migrated_data = null;
                 $step->update();
             }
         }
     }
     $this->redirect(array("step{$stepIndex}"));
 }
Exemplo n.º 8
0
            ?>
                                    <input type="checkbox" style="<?php 
            echo $id != 'rule_coupon' ? 'visibility: hidden;' : '';
            ?>
" <?php 
            echo $checked ? "checked" : '';
            ?>
 id="sales_object_<?php 
            echo $id;
            ?>
" name="selected_objects[]" value="<?php 
            echo $id;
            ?>
" />
                                    <span> <?php 
            echo $label . " (" . MigrateSteps::getTotalSalesChildObject($id) . ")";
            ?>
 </span>
                                </h4>
                            </li>
                        <?php 
        }
        ?>
                    <?php 
    }
    ?>
                </ul>
                <?php 
}
?>
            </li>
Exemplo n.º 9
0
" class="checkbox-inline">
                                <input type="checkbox" <?php 
        echo $checked ? "checked" : '';
        ?>
 <?php 
        echo $disabled;
        ?>
 id="product_type_<?php 
        echo $type_id;
        ?>
" name="product_type_ids[]" value="<?php 
        echo $type_id;
        ?>
" />
                                <?php 
        echo Yii::t('frontend', '%s Products', array('%s' => ucfirst($type_id))) . " (" . MigrateSteps::getTotalProductsByType($type_id) . ")";
        ?>
                            </label>
                        </h4>
                    </li>
                    <?php 
    }
    ?>
                </ul>
                <?php 
}
?>
            </li>
        </ul>
    </div>