我可以使用Magento管理员为现有的原始php商店供电

问题描述:

I have a previously made raw php store that uses a very simple database of products to power the site. There is no cart in this store. Basically I want to be able to use the magento admin but not it's standard theme structure with modules and such.

My old store consisted of a few files. EX.

index.php

catalog.php?category=Batteries

content.php?title=About Us

So for example... in catalog.php I want to use my same old html code but use raw php to loop through all the products in the catalog I created with the magento admin.

I just want to use my custom php pages from start to finish but use magento in between like so:

So this would be catalog.php:

<html>
...
all my other stuff I already made like the header
<?php
// then something like this
foreach ($magento_products as $product) {
    echo $product->name . '<br />';
}
?>
the all the other stuff I've already made like the footer
...
</html>

SO IS this is possible with magento? and if so, where do I put my raw php files at so they can access magento's database? If not, what is the next best way of doing this without having to create an entire magento theme.

Probably that would be possible, but

  • essentially you are using the same methods from magento (so no performance gain)
  • to keep the same amount of features, you would be required to have a lot of php pages

Long story short, the easier way would be to make some magento templates and apply your custom design.

Edit: I assumed here the easiest way for you to use magento's data in another script which is to include the magento files and use the underlying models. Taking the data directly out of the database would be even worse in terms of time and complexity.