我有一个关于清除Magento中的日志数据的问题.
我在Magento 1.4.1中有超过2.3GB的数据,现在我想优化数据库,因为由于数据的大小,它太慢了.我检查了日志信息(URL,访问者),它显示超过1.9 GB.如果我直接清除这些记录,它会影响网站中的任何功能吗?如何清除日志详细信息?通过清除这些数据,我会在我的网站上丢失或丢失任何数据吗?
我必须解析wordpress post_meta 表,特别是 "_wp_attachment_metadata"字段
例如:
它的值是post id = 99
> a:6:{s:5:"width";s:3:"238";s:6:"height";s:3:"179";s:14:"hwstring_small";s:23:"height='96'
> width='128'";s:4:"file";s:21:"2010/11/matt-lane.jpg";s:5:"sizes";a:1:{s:9:"thumbnail";a:3:{s:4:"file";s:21:"matt-lane-150x150.jpg";s:5:"width";s:3:"150";s:6:"height";s:3:"150";}}s:10:"image_meta";a:10:{s:8:"aperture";s:1:"0";s:6:"credit";s:0:"";s:6:"camera";s:0:"";s:7:"caption";s:0:"";s:17:"created_timestamp";s:1:"0";s:9:"copyright";s:0:"";s:12:"focal_length";s:1:"0";s:3:"iso";s:1:"0";s:13:"shutter_speed";s:1:"0";s:5:"title";s:0:"";}}
Run Code Online (Sandbox Code Playgroud)
我不明白它是如何编译或如何在wordpress之外解析它.我必须从wordpress加载magento平台上发布的所有数据集的最新文章.
请帮我解析这些数据以获得图像src.
提前致谢
我如何使用产品sku或id获得产品类型(简单,可配置/分组...),我已经加载了产品集合,并从中尝试通过
$_product->getTypeId()
Run Code Online (Sandbox Code Playgroud)
但它不打印产品类型.请帮我
谢谢
我想在用户尝试关闭浏览器而没有保存某些设置时提醒用户.
我在另一个页面中卸载选项以提醒卸载数据,但是如何在window.close上警告用户(它没有采取)
window.onbeforeunload = confirmExit;
function confirmExit(){
if(readCookie("onlineVD") == "playing" && Confirm_Delete=="0")
{
return "You are leaving a video which is in play mode.Are you sure want to exit this page?";
}
else{
Confirm_Delete="0";
}
}
Run Code Online (Sandbox Code Playgroud)
我想在所有浏览器中关闭选项卡和窗口关闭window.close.
请找我一个解决方案
我希望以这种方式从magento帮助程序获取自定义URL:
<action
method="addLink"
translate="label title"
module="customer">
<label>About Us</label>
<url
helper="customer/getAboutUsUrl">
about
</url>
<title>About Us</title>
<prepare/>
<urlParams/>
<position>1</position>
</action>
Run Code Online (Sandbox Code Playgroud)
所以我所做的是getAboutUsUrl()在Customer Helper Directory中的本地目录下定义一个函数.但它并没有像我预期的那样返回基本网址.
我需要做些什么来获得关于我们链接的baseurl?
谢谢
我有一个要求,我从外部应用程序获取产品ID与产品super_attribute选项,如颜色,大小.我得到了所有这些,我可以做添加到购物车选项.
但在这里,我的实际要求是按客户选择所请求的选项,并将它们重定向到magento的产品详细信息页面,这样他们仍然可以输入可选文本进行打印.因此,我需要在详细信息页面中设置所请求的选项,并将其重定向到产品详细信息页面,而不是将其添加到购物车.他们将输入更多细节,然后他们将手动添加addtocart.
如何在加载自身时设置所选选项.
请帮我.
我必须在顶部菜单链接中添加注册链接
所以我做了这个,但我不知道什么是登记的帮手.请帮我
<customer_logged_in>
<reference name="top.links">
<action method="addLink" translate="label title" module="customer"><label>Log Out</label><url helper="customer/getLogoutUrl"/><title>Log Out</title><prepare/><urlParams/><position>100</position></action>
<action method="addLink" translate="label title" module="customer"><label>My Account</label><url helper="customer/getAccountUrl"/><title>My Account</title><prepare/><urlParams/><position>10</position></action>
</reference>
</customer_logged_in>
<customer_logged_out>
<reference name="top.links">
<action method="addLink" translate="label title" module="customer"><label>My Account</label><url helper="customer/getLoginUrl"/><title>My Account</title><prepare/><urlParams/><position>100</position></action>
<action method="addLink" translate="label title" module="customer"><label>Register</label><url helper="customer/getAccountUrl"/><title>Register</title><prepare/><urlParams/><position>10</position></action>
</reference>
<remove name="wishlist_sidebar"></remove>
<remove name="reorder"></remove>
</customer_logged_out>
Run Code Online (Sandbox Code Playgroud) 我试图使用ajax在主页上使用magento中的ajax显示流行的产品列表,我可以为5或"N"no.of产品做到这一点,但我想要的是添加了结果集的分页工具栏.
这是我添加以显示受欢迎的产品,
// Magento layout
$magento_block = Mage::getSingleton('core/layout');
$productsHtml = $magento_block->createBlock('catalog/product');
$productsHtml->setTemplate('catalog/product/popular.phtml');
echo $productsHtml ->toHTML();
Run Code Online (Sandbox Code Playgroud)
并在popular.phtml下
<?php
$_productCollection = Mage::getModel('catalog/product')->getCollection()
->addPriceData()
->addAttributeToSort('ordered_qty', 'DESC')
->addAttributeToSort('name', 'ASC')
->setPageSize($limit)
->setPage($p, $limit)
->addAttributeToSelect(array('entity_id', 'entity_type_id', 'attribute_set_id', 'type_id', 'sku', 'category_ids', 'created_at', 'updated_at','has_options', 'sync', 'name', 'stock_status', 'wc_review_iwc_rating', 'wc_review_wa_rating', 'wc_review_bh_rating', 'small_image', 'status', 'pre_arrival', 'description', 'short_description', 'price', 'is_salable', 'stock_item', 'gift_message_available', 'featured'));
?>
Run Code Online (Sandbox Code Playgroud)
所以这给了我指定页面和限制的流行产品,但我无法加载分页工具栏(通过直接将工具栏添加到popular.phtml或通过创建块布局功能),哪里错了?请有人告诉我.
谢谢
我目前正在开发一个不应该暴露其开发人员magento平台的网站(很抱歉).
我认为wappalyzer(Mozila插件),GTmetrix网站正在通过其html格式找到cms名称,但是当我看到一个带有该工具的空白页时,它仍然显示我正在使用Magento(源视图中没有任何东西 - 它的白色页面),现在他们如何发现使用magento.他们有什么想法吗?我检查了标题,但没有特别提到的magento.与wordpress/joomla相同 - 简单的wappalyzer(Mozila插件),GTmetrix找到了站点平台,即使没有HTML源.
所以我想在标题(我可能会遗漏某些东西)或它可能是什么?请指教.附上它的截图.

提前致谢
在magento中如何从其产品ID获取每个产品的类别ID.
$items = $request->getAllItems();
$c = count($items);
for ($i = 0; $i < $c; $i++) {
if ($items[$i]->getProduct() instanceof Mage_Catalog_Model_Product) {
if ($items[$i]->getProduct()->getId()) {
$this->_dhlAllowed = false;
}
}
}
Run Code Online (Sandbox Code Playgroud)
这里$items[$i]->getProduct()->getId()返回产品ID.我想要它的类别ID.