texts: Magento (1.7) Bundled Product with FREE Product Option

texts:
I'm looking to create a bundle offer where customers can buy two items from a collection (30 products with varying prices) and they get a fixed third item which is a FREE product.

As the final price will vary depending on what the customer chooses, how do I make the basket subtotal add the two items but ignore the third priced item?

Hope that makes sense


texts:
I am looking at core code now, going over things preparing for sitting certification and for the first time have come across resource helpers.

I am a little confused actually as at first it looks as though these should be intended for 'helper' type tasks relating specifically to resource models, i.e. database related generel tasks.

However, they are used so infrequently in core code that im doubting that assumption.  If this were true I can see a ton of places throughout core code they could be put to use but are not.

Can anyone explain exactly what these are to be used for and if they are still used or it is more a legacy thing?


texts: Change Hover color of categories in magento

texts: you can see Categories in left side, If you hover  category names , you can see it will change to pink color, how to chagne the color from pink to green.


texts: How do I change the default value of the "position" category attribute?

texts:
I would like to update the default position value that products are assigned when they are added to a category. When you update a category from the categories editor, new products are saved with a position of 0. When you add a product to a category via the tree when filling out the product, it saves with a position value of 1.

What I want to do is have items save with a position of 100 instead of 1.


texts: Am I vulnerable if the public has access to my customer IDs?

texts: I created a referral program that uses a custom referral link and it includes the customer ID. I assume this is bad practice, but what specifically did I open myself up to? (If anything)


texts:
I am trying to get the details of a product whose quote has been inactive. I am getting the following error when i use the this code.

$cartItem = $this->quoteItem->load($itemId);
return $cartItem->getProduct();

  Uncaught Error: Call to a member function getStoreId() on null in /var/www/vhosts/avesh/vendor/magento/module-quote/Model/Quote/Item/AbstractItem.php:146


texts: "Additional Data" in Magento 2 Checkout Order Summary

texts:
I have overidden the template:

/Magento_Checkout/web/template/summary/item/details.html

For each row, if set, I need to display the "additional_data" field. I can get the value for an arbitrary row by using (e.g. for the first row):

window.checkoutConfig.quoteItemData[0].additional_data

But I can't work out how to display it for the current row in the Knockout template. The $parent object which is used to output the product's price, custom options, etc, does not expose this information.

Can anyone help?


texts:
I am using  social login extension . problem is that when I am trying to login with Facebook and it's showing blank page and url redirecting unconditional .

And this is the url value

 http://www.example.com/sociallogin/fblogin/login/auth/1/?code=AQB58NO2tKX2vBFdGUPfXQSnxkvgbelAdvCvLf0uK8NF96v7zqput2fD0lKbTk6SbhWrc-rhUvf8ZTlncNIIbt8agvScVkSecpGE5fQdXTKmHMSjbxhXaIXPSnLHkUQ0f50znzvDivomUTWqCmbjqcVdxVqjgqekkFweTrLdrvXsULHI4-mMD0RWCLZzcM7sZosjmQlBPcVGja03vzocaYUuyildfwVjZJi6KJzh3JtRkHPg7HrFVdnN21M3zkiweXBhaRRIBo-iuHrtrjr0EuKiNQ2RYTZukHGkKZy6f6_qraaGzi-RAHHc0cY1pCnNUYHnOV2LdAe27KxwdmUXrGLE&state=1fe758f00f8e90246e783f1e5fb3f89d#_=_


texts: In custom mail getTemplateVars returs null

texts:
I'm using checkout_onepage_controller_success_action event to trigger my custom mail based on my requirement.I already added my email template variables using email_order_set_template_vars_before event. when I'm tring to get variables using $this->templateContainer->getTemplateVars()  in checkout_onepage_controller_success_action returns null.
Now my issue is I need to set templatevar using $this->templateContainer->getTemplateVars() in checkout_onepage_controller_success_action event


texts:
I am new to magento. If I use the Package upgrade available through magento connect downloader do I need to backup and overwite my custom files as in the upgrade roadmap when upgrading a full magento installation?

For modules such as Lib_Magento, Lib_Mage & Lib_Unserialize ,,,etc. I am in version 1.9.2.3 would like to upgrade to 1.9.2.4.

If this is not the correct path please suggest the correct way.


texts:
I would like to change product rest endpoint like for delete operation default endpoint is rest/V1/products/test_simple_product3 I would like to add one more param to this endpoint.
like rest/V1/products/test_simple_product3/companyid/3
can we do it without touching core file or we will need to extend core file for this.
Please suggest best approach for this.


texts:
I have created 2 custom themes for the site, and applied one of theme as the theme store.
But my webpage/store is loading the layout of the theme which is not been applied. I have been struggling with this since 2 days, still no luck.
I have tried to modify the theme table from the db as well where I made all the types to 0. cleared caches n number if times, removed pub/static/frontend folder, Even if I delete the theme it is not loading the layout of the applied theme.
Anything which I have not tried yet?
My theme structure is below:
Theme 1:
root/app/design/frontend/Theme1/customtheme/Magento_Theme/layout&templates
         root/app/design/frontend/Theme1/customtheme/Magento_Catalog/layout&templates
      root/app/design/frontend/Theme1/customtheme/Magento_Checkout/layout&templates

Theme 2:
root/app/design/frontend/Theme2/customtheme/Magento_Theme/layout&templates/

root/app/design/frontend/Theme2/customtheme/Magento_Catalog/layout&templates/

root/app/design/frontend/Theme2/customtheme/Magento_Checkout/layout&templates

magento version: 2.4.1


texts: Not able to edit color attribute magento 2.0.0

texts:
when I try to save color attribute error display
Error :Admin is a required field in the each row

http://awesomescreenshot.com/05e65t0g1c

all other attribute working fine but the only issue with a color attribute.
I am using Magento 2.0.0


texts: Magento 2 : How to get product get images for thumbnail?

texts: Friend please help me how to get product images and thumbnail images.


texts: Magento2 add product to cart with customizable options seperately

texts:
Magento2 How can I add product to cart with customizable options seperately.
For e.g. IF user selects 2 checkbox of customizable options & adds products to cart, then in cart the products should be added seperately with each option.


texts: Magento2 : display static blocks in home page

texts:
How to display static blocks in the home page. I want to show a static block on the home page.I am overriding module_cms and add this code in cms_index-index but it's showing only last block

<referenceContainer name="content.bottom">
  <block class="Magento\Cms\Block\Block" name="block_identifier">
    <arguments>
      <argument name="block_id" xsi:type="string">block1</argument>
    </arguments>
  </block>

  <block class="Magento\Cms\Block\Block" name="block_identifier" after="-">
    <arguments>
      <argument name="block_id" xsi:type="string">block2</argument>
    </arguments>
  </block>

How to show all blocks


texts: Uninstall meta package with related extensions

texts:
I created 2 (but planning to create 999 :) ) extensions and a meta package for it.

The meta package extension contains only composer.json`

{
    "name": "sergei/module-main",
    "version": "1.0.0",
    "type": "metapackage",
    "require": {
        "sergei/module-one": "1.0.0",
        "sergei/module-two": "1.0.0"
    }
}

For installation I run composer require sergei/module-main and all of required modules

sergei/module-one (Sergei_One in registration.php)
sergei/module-two (Sergei_Two in registration.php)

were successfully installed.

Each of these modules has Setup/Uninstall.php

In vendor directory metapackage (suppose sergei/module_main) was't added and I cannot run bin/magento module:uninstall Sergei_Main

How can I  run bin/magento module:uninstall for meta package?

I run bin/magento module:uninstall Sergei_One Sergei_Two - it works, but this method is ugly for me:

Sergei_One and Sergei_Two (... planning to create 999+ extensions...)) were deleted, but link to the meta package extension
remain in the composer.json file.


texts: XML Error - Premature end of data in tag widgets line 3 Line: 40

texts:
I have looked over a few times and cant see any tags that are not closed so im lost on whats wrong. I am new to XML and would love the help.
<?xml version="1.0" ?>
<widgets xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:ZaniboniCustom:Magento_Widget:etc/widget.xsd">
    <widget class="ZaniboniCustom\productWidget\Block\Widget\ProductGrid" id="ZaniboniCustom_productWidget">
    Product Widget
    <description>Show Products</description>
        <parameters>
            <parameter name="title" xsi:type="text" required="false" visible="true">
                Title
            </parameter>
            <parameter name="products_sort_by" xsi:type="select" visible="true" source_model="ZaniboniCustom\productWidget\Model\SortBy">
                Sort Products By
            </parameter>
            <parameter name="products_sort_order" xsi:type="select" visible="true" source_model="ZaniboniCustom\productWidget\Model\SortOrder">
                Sort Products Order
            </parameter>
            <parameter name="show_pager" xsi:type="select" visible="true" source_model="Magento\Config\Model\Config\Source\Yesno">
                Display Page Control
            </parameter>
            <parameter name="products_per_page" xsi:type="text" required="true" visible="true" source_model="Magento\Config\Model\Config\Source\Yesno">
                Number of Products per Page
                <depends>
                    <parameter name="show_pager" value="1" />
                </depends>
                <value>5</value>
            </parameter>
            <parameter name="products_count" xsi:type="text" required="true" visible="true">
                Number of Products to Display
                <value>10</value>
            </parameter>
            <parameter name="template" xsi:type="select" required="true" visible="true">
                Template
                <options>
                    <option name="default" value="Magento_catalogWidget::product/widget/content/grid.phtml" selected="true">
                        Products Grid Template
                    </option>
                </options>
            </parameter>
        </parameters>
    </widget>
</widgets>


texts:
I have my module config like this

<config>
    <modules>
        <Foo_Bar>
            <version>1.0.0</version>
        </Foo_Bar>
    </modules>
    <global>
        <blocks>
            <foo_bar>
                <class>Foo_Bar_Block</class>
            </foo_bar>
        </blocks>
    </global>
</config>

I have my block class in the file

/app/code/local/Foo/Bar/Block/random.php

with content

class Foo_Bar_Block_Random extends Mage_Core_Block_Template {

  function __construct() {
    echo __METHOD__;
  }
}

I am expecting the method to be echoed in my home page(checking whether my block is working fine). But it is not echoing the method block method name

my /etc/config is

<config>
    <modules>
        <Foo_Bar>
            <active>true</active>
            <codePool>local</codePool>
        </Foo_Bar>
    </modules>
</config>

can somebody tell me what am i doing wrong?


texts: Fatal error on only some of my category pages

texts:
I updated yesterday to 1.9 CE and now my category pages I get this fatal error:

  Fatal error: Call to undefined method Mage_Catalog_Model_Resource_Category_Flat_Collection::joinUrlRewrite() in /home/senorehe/public_html/app/code/local/Mage/Catalog/Block/Navigation.php on line 155

This is the section it is referring to

public function getCurrentChildCategories()
   {
        $layer = Mage::getSingleton('catalog/layer');
        $category   = $layer->getCurrentCategory();
        /* @var $category Mage_Catalog_Model_Category */
        $collection = Mage::getModel('catalog/category')->getCollection();
        /* @var $collection Mage_Catalog_Model_Resource_Eav_Mysql4_Category_Collection */
        $collection->addAttributeToSelect('url_key')
            ->addAttributeToSelect('name')
            ->addAttributeToSelect('is_anchor')
            ->addAttributeToSelect('image')
            ->addAttributeToFilter('is_active', 1)
            ->addIdFilter($category->getChildren())
            ->setOrder('position', 'ASC')
line 155        ->joinUrlRewrite()
            ->load();

        $productCollection = Mage::getResourceModel('catalog/product_collection');
        $layer->prepareProductCollection($productCollection);
        $productCollection->addCountToCategories($collection);
        return $collection;
    }

I have tried reindexing the URL, flushing my mage_core_url_rewrite then reindexing. But nothing had worked so far.

Can anybody help me with this?


texts: Error Code: 1022. Can't write; duplicate key in table x - While Restoring Database Backup

texts:
I am trying to restore a database backup to my local project, however I'm getting this error. I searched and found out that it is because I am trying to set an existing constraint name when I run the backup file. But i don't know how to solve it. I tried to rename the constraints, but there are a loooot of it and it's impossible to rename all of them, one by one. Can anyone help me?

One piece of my code is this:

DROP TABLE IF EXISTS `apscatalog_product_entity_media_gallery`;

CREATE TABLE `apscatalog_product_entity_media_gallery` (
  `value_id` int(10) unsigned NOT NULL AUTO_INCREMENT COMMENT 'Value ID',
  `attribute_id` smallint(5) unsigned NOT NULL DEFAULT '0' COMMENT 'Attribute ID',
  `entity_id` int(10) unsigned NOT NULL DEFAULT '0' COMMENT 'Entity ID',
  `value` varchar(255) DEFAULT NULL COMMENT 'Value',
  PRIMARY KEY (`value_id`),
  KEY `IDX_CATALOG_PRODUCT_ENTITY_MEDIA_GALLERY_ATTRIBUTE_ID` (`attribute_id`),
  KEY `IDX_CATALOG_PRODUCT_ENTITY_MEDIA_GALLERY_ENTITY_ID` (`entity_id`),
  CONSTRAINT `FK_CAT_PRD_ENTT_MDA_GLR_ATTR_ID_EAV_ATTR_ATTR_ID` FOREIGN KEY (`attribute_id`) REFERENCES `apseav_attribute` (`attribute_id`) ON DELETE CASCADE ON UPDATE CASCADE,
  CONSTRAINT `FK_CAT_PRD_ENTT_MDA_GLR_ENTT_ID_CAT_PRD_ENTT_ENTT_ID` FOREIGN KEY (`entity_id`) REFERENCES `apscatalog_product_entity` (`entity_id`) ON DELETE CASCADE ON UPDATE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='Catalog Product Media Gallery Attribute Backend Table';


texts: I need to put some prices into a CMS page. How can I insert and display them accordingly to the currency selected?


texts: Not possible update magento 2.1.11 to 2.2.2

texts:
I try to update magento version from 2.1.11 to 2.2.2 because have some bugs.

So according to the documentation magento run first command via ssh:

php bin/magento composer require magento/product-community-edition 2.2.2 --no-update

Unfortunately, when I run this command, I get an error:

anyone know how to solve it ?

EDIT:
after run command

composer require magento/product-community-edition 2.2.2 --no-update

EDIT2: Error during check composer version:


texts: Checking if customer is login not refreshing

texts:
Now I implement the code below

use Magento\Framework\App\Helper\AbstractHelper;
use Magento\Customer\Model\Session;
use Magento\Framework\App\Http\Context as AuthContext;

class Customer extends AbstractHelper
{
    /**
     * @var \Magento\Framework\App\Http\Context
     */
    private $httpContext;
    private $objectmanager;
    private $authContext;

    public function __construct(
        \Magento\Framework\App\Helper\Context $context,
        \Magento\Framework\App\Http\Context $httpContext,
        \Magento\Framework\ObjectManagerInterface $objectmanager,
        Session $session,
        AuthContext $authContext
    ) {
        $this->objectmanager = $objectmanager;
        $this->httpContext = $httpContext;
        $this->customerSession = $session;
        $this->authContext = $authContext;

        parent::__construct($context);
    }

    public function isLoggedIn()
    {
        $isLoggedIn = $this->authContext->getValue(\Magento\Customer\Model\Context::CONTEXT_AUTH);

        return $isLoggedIn;
    }

But when I refresh my page it still say that it's login eventhough I already logged out. Below is the code of my template

<?php
    $customerHelper = $this->helper('Vendor\Module\Helpers\Customer');
?>

<?php if ($customerHelper->isLoggedIn()): ?>

        <a href="<?= $this->getUrl('customer/account'); ?>"><?= $block->escapeHtmlAttr(__('Account')) ?>

        <a href="<?= $this->getUrl('customer/account/logout'); ?>"><?= $block->escapeHtmlAttr(__('Logout')) ?>

<?php else: ?>

        <a href="<?= $this->getUrl('customer/account/login'); ?>"><?= $block->escapeHtmlAttr(__('Login')) ?>

<?php endif; ?>

Update:
- When I logout the account still thinks that I'm still login. When checking the function response it says that I'm still logged in. I'm not sure how to fix this. Upon checking the session when I'm logged out there are no values of firstname for the mage_cache_storage. But when I'm loggedin its being populated. I think a Javascript is populating this value that's why the PHP script still thinks I'm logged in.. I'm not sure how to fix this


texts: Keeping module compatible for different Magento versions

texts:
Today, I am running into the following problem:
A module I developed works very well in a Magento 1.7 version store.
Now, I need to adapt it to also work with a Magento 1.5 store.

One point at which the compatibility runs apart is in my collection where I am exending the class Mage_Core_Model_Resource_Db_Collection_Abstract. This class does not exist in Magento 1.5, but it has some nice functionality like getMainTable().
One thing I could do is to instead use the class Varien_Data_Collection_Db which is inherited from in Mage_Core_Model_Resource_Db_Collection_Abstract.
This works, but then I cannot use the getMainTable() method anymore - even not in the 1.7 store where it actually exists.

How do you handle such version specific quirks?
It seems absurd to write a custom class which implements the stuff version 1.7 already has and thereby duplicate code in that version.
On the other hand, it is bad not to have the function and use worse coding habits like hard-coding instead.
So, is there any good approach in writing Magento modules which are backwards-compatible?


texts: access variables / array in media.phtml on description.phtml

texts:
I created variable in my media.phtml say some array $abc= array(1,2,3). Now, when I do print_r($abc) in my description.phtml,
it gives blank value. I was guessing can I access that or have to call same function twice( function that creates array).

Is there any way to do that?

In view.phtml, media.phtml is writted before description.phtml so logical it must give value there also.


texts: I want to update quote by quote id I have quote id . I have created the custom function on that function every time it's creating new quote row . I want to check if quote exists then update only else create.


texts: Magento2.3 - Change Porto RTL theme font

texts:
Been trying to change porto rtl fonts for quite sometime now.
I have tried to edit every single file you can imagine I lost count and names, I've edited XML files, PHP files, CSS files. tried from the Admin panel > Porto > Design Panel > Fonts, nothing is working at all, not a single line have changed in the css file.
Any ideas?


texts: Is there any way to add reviews to specified attribute like manufacturer?

texts:
I created an attribute called seller with all properties of manufacturer. I am showing that attribute on product view and list pages successfully. My question is: How to allow customers to write review and ratings for that seller attribute as like for products?
Is these possible?

If it is possible: How to achieve that?

Any ideas, suggestions would be helpful :)


texts: How to switch between PHP versions on Ubuntu Nginx

texts:
I have PHP 7.0 and 7.2 installed.

For now, I use PHP 7.0.

How can I switch to PHP 7.2?


texts: Captcha taking too so much disk space in magento 1.9.2.4

texts:
When I took backup of full-site and database, 3 months ago, size of captcha was 48mb but now size is increasing.

now I have checked it's taking more than 4 gb disk space.

Full-site database backup zip is 7gb and captcha size is more than 4gb. It is also creating a problem when i extract my fullsite website because captcha is taking too much time to extract.

I am unable to find the reason why are captcha counts and size increasing.


texts: How to Implement Ajax Pagination in Custom module

texts:
Phtml File

 $('.pagination a').on('click', function() {
       var pagNo = $('a').val();

          $("#data-loader").css("background", "url("+ajaxloader+") no-repeat");
           $("#data-loader").addClass('data-loader');

         $.ajax({
                            method: "POST",
                            dataType: "json",
                            url: "<?php echo $block->getAjaxUrl() ?>",
                            data: { PagNo: PagNo}
                    }).done(function( res ) {

                        //alert(res.Data);
                        //capt2();
                          $("#data-loader").removeClass('data-loader');
                        $('#ajax').html('');
                         $('#ajax').html(res.Data);
                         capt2();
                            if(res.error === false){

                               // alert(res.error);

                            }
                            else{
                                // alert(res.message);
                            }
                   });
    })

  &laquo;
  1
  2
  3
  4
  5
  6
  &raquo;

Block File

public function getProductPageAjax($product_id, $type, $arrow, $pagNo)
{

    $collection = $this->_Model->getCollection()
                                    ->joinProductAttachmentTable()
                                    ->addFieldToFilter('product_id', $product_id)
                                    ->addFieldToFilter('main_table.status', 1)
                                    ->joinTopicTable()
                                    ->addFieldToFilter('topic_table.identifier', 'product');

    $this->setCollection($collection);

    $collection->setLimit(1)->setShowPerPage(false)->setCurPage($pagNo)
    ->setShowAmounts(false)
    ->setCollection($this->getCollection());
    $collection = $this->getCollection()->load();

    return $collection;
 }

Controller File

public function execute()
{
     $resultJson = $this->jsonFactory->create();

         $params = $this->getRequest()->getParams();

   // $resultPage = $this->resultPageFactory->create();

    $faqsHelper = $this->_objectManager->get('Vendor\Module\Helper\Data');

    $values[] = $params['value'];
    $values[] = $params['proid'];
    $values[] = $params['sortbyarrow'];
    $values[] = $params['PagNo'];

    $data= $this->_view->getLayout()
                 ->createBlock("Vendor\Module\Block\Product\MyBlock")
                 ->setTemplate("Vendor_Module::myphtml.phtml")
                 ->setData('sort_type', $values)
                 ->toHtml();

     return  $resultJson->setData([
            'Data' => $data,

       ]);

    //return $resultPage;
}

I don't know how to implement it, please guide me to implement it.


texts: Pull data of orders having non-zero subtotal for each customer

texts:
I want the count of the orders which each customer has placed. Only those order which has non-zero subtotal should be counted. How can I get that data? Please let me know if we can use any SQL query

I have fetched data through query but it gives a count of all the orders, whereas I want only those orders which have non - zero value

$sql_results = "SELECT
    CONCAT(FORMAT(SUM(sales_flat_order.`grand_total`), 2)) AS 'Lifetime_Sales',
    COUNT(sales_flat_order.entity_id) AS 'Orders',
    customer_entity.email AS 'Email',
    customer_entity_varchar.value AS 'name',
    customer_address_entity_varchar.value AS 'Mobile'
FROM `customer_entity`
    LEFT JOIN sales_flat_order ON customer_entity.entity_id = sales_flat_order.customer_id
    LEFT JOIN customer_entity_varchar ON customer_entity.entity_id = customer_entity_varchar.entity_id
    LEFT JOIN customer_address_entity ON customer_entity.entity_id = customer_address_entity.parent_id
    LEFT JOIN customer_address_entity_varchar ON customer_address_entity.entity_id = customer_address_entity_varchar.entity_id
    WHERE customer_entity_varchar.attribute_id = 986 AND customer_address_entity_varchar.attribute_id = 17
GROUP BY customer_entity.entity_id
ORDER BY SUM(sales_flat_order.`grand_total`) DESC
LIMIT 10000 OFFSET 0";


texts: Magento 1.9 - How to post data from predispatch event to controller action

texts:
I want to change the data that is processed in the checkout_onepage_saveBilling controller action.

I am using an observer with the predispatch event to catch the POST data which is coming from the address form in the checkout and manipulate the values.

How can I transfer this data to the controller action now?

This is my observer:

public function validateAddress($observer)
{

    $controller = $observer->getControllerAction();
    $action = $controller->getFullActionName();

    if ($action == "checkout_onepage_saveBilling") {
        $post = Mage::app()->getRequest()->getPost();
        $post[billing][postcode] = trim($post[billing][postcode]);
        $post[billing][city] = trim($post[billing][city]);
    }

}


texts:
Magento 1.9.  Are the caches built by Refresh or built dynamically when user accesses?

My experience is, after caches refreshed, first time user accesses link it's slow but all subsequent times it's fast.

Also, all my Indexes are "Update on Save" mode, Status = Ready and Update Required = No.  Can I trust those green bars or should I manually Reindex?

TIA.


texts:
2016-04-13T05:30:56+00:00 ERR (3): Warning: SimpleXMLElement::__construct(): Entity: line 4: parser error : error parsing attribute name  in app\code\core\Mage\AdminNotification\Model\Feed.php on line 173
2016-04-13T05:30:56+00:00 ERR (3): Warning: SimpleXMLElement::__construct(): ts}if(&quot;function&quot;==typeof __nr_require)return __nr_require;for(var o=0;o&lt;n.length  in app\code\core\Mage\AdminNotification\Model\Feed.php on line 173
2016-04-13T05:30:56+00:00 ERR (3): Warning: SimpleXMLElement::__construct():                                                                                ^  in app\code\core\Mage\AdminNotification\Model\Feed.php on line 173
2016-04-13T05:30:56+00:00 ERR (3): Warning: SimpleXMLElement::__construct(): Entity: line 4: parser error : attributes construct error  in app\code\core\Mage\AdminNotification\Model\Feed.php on line 173
2016-04-13T05:30:56+00:00 ERR (3): Warning: SimpleXMLElement::__construct(): ts}if(&quot;function&quot;==typeof __nr_require)return __nr_require;for(var o=0;o&lt;n.length  in app\code\core\Mage\AdminNotification\Model\Feed.php on line 173
2016-04-13T05:30:56+00:00 ERR (3): Warning: SimpleXMLElement::__construct():                                                                                ^  in app\code\core\Mage\AdminNotification\Model\Feed.php on line 173
2016-04-13T05:30:56+00:00 ERR (3): Warning: SimpleXMLElement::__construct(): Entity: line 4: parser error : Couldn't find end of Start Tag n.length line 4  in app\code\core\Mage\AdminNotification\Model\Feed.php on line 173
2016-04-13T05:30:56+00:00 ERR (3): Warning: SimpleXMLElement::__construct(): ts}if(&quot;function&quot;==typeof __nr_require)return __nr_require;for(var o=0;o&lt;n.length  in app\code\core\Mage\AdminNotification\Model\Feed.php on line 173
2016-04-13T05:30:56+00:00 ERR (3): Warning: SimpleXMLElement::__construct():                                                                                ^  in app\code\core\Mage\AdminNotification\Model\Feed.php on line 173

I got this error in my site i don't know what is the problem any one guide me what is the problem ?


texts: Add new total to grand total using observer in Magento?

texts:
I want to add some extra amount to Grand total in Magento. So in checkout page, order review section will look like this:

This extra charges will depends on some conditions.
My question is: How can I change the grand total in checkout page? For this what I did is: I create a module. Please look my code:
app/code/local/Locwiseship/Customprice/etc/config.xml
<?xml version="1.0"?>
<config>
    <modules>
        <Locwiseship_Customprice>
            <version>1.0.10</version>
        </Locwiseship_Customprice>
    </modules>
    <global>
        <events>
            <!-- Création éventuelle du lien de parrainage lors de la commande -->
            <sales_quote_collect_totals_after>
                <observers>
                    <set_custom_price_locwiseship>
                        <type>singleton</type>
                        <class>Locwiseship_Customprice_Model_Sales_Quote_Address_Total_Mytotal</class>
                        <method>collect</method>
                        <method>fetch</method>
                    </set_custom_price_locwiseship>
                </observers>
            </sales_quote_collect_totals_after>
        </events>
    </global>
</config>

app/code/local/Locwiseship/Customprice/Model/Observer.php
<?php

/**
 * @category   Locwiseship
 * @package    Locwiseship_Customprice
 */
class Locwiseship_Customprice_Model_Sales_Quote_Address_Total_Mytotal
    extends Mage_Sales_Model_Quote_Address_Total_Abstract
{
    public function __construct()
    {
        $this->setCode('mytotal');
    }

    public function collect(Mage_Sales_Model_Quote_Address $address)
    {
        parent::collect($address);

        foreach ($this->_getAddressItems($address) as $item) {
            // These two lines represent whatever logic you're
            // using to calculate these amounts
            $baseAmt = 10;
            $amt = 10;

            // Set the item's total
            $item->setBaseMytotalAmount($baseAmt);
            $item->setMytotalAmount($amt);

            // These methods automatically take care of summing
            // "mytotal_amount" on the quote address
            $this->_addBaseAmount($baseAmt);
            $this->_addAmount($amt);
        }
        return $this;
    }

    public function fetch(Mage_Sales_Model_Quote_Address $address)
    {
        // Naturally, this exists on the quote address because "collect" ran already
        $amt = $address->getMytotalAmount();

        if ($amt != 0) {
            $address->addTotal(array(
                'code' => $this->getCode(),
                'title' => Mage::helper('Locwiseship_Customprice')->__('My Total'),
                'value' => $amt
            ));
        }
        return $this;
    }
}

app/etc/modules/Locwiseship_Customprice.xml
<?xml version="1.0" encoding="UTF-8"?>
<config>
    <modules>
        <Locwiseship_Customprice>
            <active>true</active>
            <codePool>local</codePool>
        </Locwiseship_Customprice>
    </modules>
</config>

Thais is my code. But Nothing happened..This is not working..
Is this the correct approach? How can I make this working? Please help me..
I am using Magento 1.9.0.1


texts: Magento 1.9.4.1 - SUPEE-10975 - Failed. Outdated JQuery library v.1.12.0 found (PRODSECBUG-2108), got '200'

texts:
I got an email this morning from the Magento.com security scan.

My Magento site running 1.9.4.1 just received the following issue:

  SUPEE-10975 - Failed. Outdated JQuery library v.1.12.0 found
  (PRODSECBUG-2108), got '200'.

Looking at PRODSECBUG-2108 it is only an update of JQuery from 1.12.0 to 1.12.1 to stop it causing PCI scanning failures.

In my /js/lib/jquery folder I have the following:

noconflict.js
jquery-1.12.1.min.map
jquery-1.12.1.min.js
jquery-1.12.1.js
jquery-1.12.0.min.map
jquery-1.12.0.min.js
jquery-1.12.0.js
jquery-1.10.2.min.map
jquery-1.10.2.min.js
jquery-1.10.2.js

Do you know if I am ok to delete the older versions without any problems?

Cheers,
Tim


texts: Database-Based & Redis-Based Customer-Session Empty Data Issue in Magento 2 Using 2 Web-Servers

texts:
I am facing a problem in getting session data in Magento 2, when I deploy my Build on 2 Web-Servers. I am facing no issue on Single Web-Server.

  Problem Details I am setting some data in session, in first AJAX request, and then getting that data in the next consecutive AJAX
  request but the session returns no values.

AJAX-Request Format:

jQuery.ajax({
    url: myUrl,
    type: 'POST',
    dataType: 'json',
    data: myData,
    cache: false,
})

Problem Resolution Approaches

Printed overall session data and found empty customer data. Only the following data is returned.

Array([customer_segment_ids] => Array([1] => Array([0] => 3))[wishlist_item_count] => 0)
Tried to load session data using ObjectManager, while created object of \Magento\Customer\Model\Session and provided the SessionID to get data from the Database-Table using my custom code, but it returned empty array.
Tried to load session data using MySQL Custom Query by SessionID on that table and got data.
Changed Session storage to Redis in my app/etc/env.php file, as directed here, but got the same empty session issue.
Changed Session storage to Files in my app/etc/env.php file and I got the correct data as expected.

Can I have a solution for this problem?


texts: Is it a bad idea to allow magento upload SVG file for CMS page?

texts: One of my user request to ask me to make the Magento able to upload svg file to the CMS. I did some research, some say security issue, but didn't tell much what kind of security issue it may happen. Anyone can give me a clear advice? Thanks


texts: Magento EE 1.14.2.2 Upgrade Script add multiple Columns

texts:
Hello I'm struggling to get an upgrade script working. Here is my script:

$installer = $this;

$installer->startSetup();

// Update table

$installer->getConnection()
->addColumn($installer->getTable('mymodelalias'),
    'new_column1',
    array(
        'type' => Varien_Db_Ddl_Table::TYPE_SMALLINT,
        'length' => 1,
        'nullable' => false,
        'default' => 0,
        'comment' => 'My Column 1')
)
->addColumn($installer->getTable('mymodelalias'),
    'new_column2',
    array(
        'type' => Varien_Db_Ddl_Table::TYPE_INTEGER,
        'nullable' => true,
        'comment' => 'My Column 2')
)
->addColumn($installer->getTable('mymodelalias'),
    'new_column3',
    array(
        'type' => Varien_Db_Ddl_Table::TYPE_TEXT,
        'length' => 100,
        'nullable' => true,
        'comment' => 'My Column 3')
)
->addColumn($installer->getTable('mymodelalias'),
    'new_column4',
    array(
        'type' => Varien_Db_Ddl_Table::TYPE_TEXT,
        'length' => 255,
        'nullable' => true,
        'comment' => 'My Column 4')
);

$installer->endSetup();

I get this error

  Call to undefined method Varien_Db_Statement_Pdo_Mysql::addColumn() in "/Users/myname/app/code/local/Myvendor/Mymodule/sql/myvendor_mymodule_setup/upgrade-0.1.0.2-0.1.0.3.php" line 19

Any idea what's the issue?


texts:
Is there currently anyway to extend bluefoot functionality (bluefoot)? I found that its vendor folder is located at vendor/gene/bluefoot. Let's say I wanted to add another tab to the panel on the right of the wysiwyg.

If it can be extended, could I do it inside my custom theme like I would extend core magento modules? Or would it have to be altered inside the vendor folder?


texts:
I've looked in the existing post I couldn´t really find an answer..

So my question is simple : I already have a "Home" menu before all my menu, but this is a simple text. I'd like to put Font awesome icon, or at least a picture but the title of the category doesn't allow to put image or any code.

    <?php $_menu = $this->getHtml('level-top') ?>
<?php if($_menu): ?>

        <?php echo $_menu ?>

<?php endif ?>

How could I put a icon before all of my menus ?

Thanks a lot

EDIT : does the file to edit is find in the here : app/design/frontend/default/theme/template/page/html
 ??

I edited topmenu.phtml with this but nothing shows up ... and i did the same for top.phtml..

<a href="<?php echo $this->getUrl('home') ?>">Home

    <?php echo $_menu ?>


texts:
When try run command in terminal example
php bin setup:upgrade
show like these error messages. Not only that but also all commands

  -[ReflectionException]
      Class Magento\Config\Console\Command\ConfigSet\ProcessorFacadeFactory does
  not exist.
  - [ReflectionException]
      Class Magento\Config\Console\Command\ConfigSet\ProcessorFacadeFactory does
  not exist.
  - [RuntimeException]
      Can't create directory /var/www/html/robolk/generated/code/Magento/Config/Console/Command/ConfigSet/.
  in [Magento\Config\Console\Command\ConfigSet\ProcessorFacadeFactory].

Why is Magento showing these errors?


texts: Add custom column and filter to customer grid from joined table in magento 2

texts:
I need to add custom column and filter in the customer grid in Magento 2 admin. The column attribute is from different modules. There are many solutions for sales order grid, but none (or incomplete) for customer grid.

I had the same issue, so I found the solution by myself. The solution is in the answer.


texts: Magento 2 How to add new address in 'customer_address_entity' from helper?

texts:
I am using helper data function to add the new address in customer_address_entity but it is not working. code as below :

<?php

namespace Name\Module\Helper;

use \Magento\Framework\App\Helper\AbstractHelper;

class Data extends AbstractHelper
{
    protected $addressDataFactory;
    protected $addressRepository;

    public function __construct(
       \Magento\Customer\Api\Data\AddressInterface $addressDataFactory,
       \Magento\Customer\Api\AddressRepositoryInterface $addressRepository
   ) {
        $this->addressDataFactory = $addressDataFactory;
        $this->addressRepository = $addressRepository;
    }
    public function assignAddressToCustomer($location,$customer)
    {
        $address = $this->addressDataFactory;

        $address->setFirstname($customer->getData('firstname'))
        ->setLastname($customer->getData('lastname'))
        ->setCustomerId($customer->getData('entity_id'))

        ->setCountryId($location->getData('country_id'))
        ->setRegionId($location->getData('region_id'))
            //->setRegion($location->getData('region'))
        ->setCity($location->getData('city'))
        ->setPostcode($location->getData('postcode'))
        ->setStreet(array($location->getData('street')))
        ->setTelephone($location->getData('telephone'))
        ->setData('save_in_address_book', '1');

        try{
          $this->addressRepository->save($address);
      }catch (Exception $e) {
        Zend_Debug::dump($e->getMessage());
    }

    return;
}
}

It goes in try section, but in the database, there is no update.
Is there something missing?

i am trying but it gives error as below :

it gives error in apache log "PHP Fatal error:

Uncaught Exception: User Error: Some transactions have not been committed or rolled back in C:\\xampp\\htdocs\\M2\\vendor\\magento\\framework\\DB\\Adapter\\Pdo\\Mysql.php on line 3955 in C:\\xampp\\htdocs\\M2\\vendor\\magento\\framework\\App\\ErrorHandler.php:61\nStack trace:\n#0 [internal function]: Magento\\Framework\\App\\ErrorHandler->handler(256, 'Some transactio...', 'C:\\\\xampp\\\\htdocs...', 3955, Array)\n#1 C:\\xampp\\htdocs\\M2\\vendor\\magento\\framework\\DB\\Adapter\\Pdo\\Mysql.php(3955): trigger_error('Some transactio...', 256)\n#2 [internal function]: Magento\\Framework\\DB\\Adapter\\Pdo\\Mysql->__destruct()\n#3 {main}\n  thrown in C:\\xampp\\htdocs\\M2\\vendor\\magento\\framework\\App\\ErrorHandler.php on line 61, referer: http://127.0.0.1/M2/admin/customer/index/new/key/1f129dbde8115d6f0c4789e039353302bbf9c039d78881f155a623a083f49d70/"


texts: Adding Newsletter subscribe input box to mails magento 2.3

texts:
We have designed an email template that includes a newsletter subscription input box in footer.
Screenshot:

This is what email template footer looks like. Now the subscribe button does not work.
Following action is given to this input box
<form action="www.magento.com/newsletter/subscriber/new/" method="post" id="newsletter-validate-detail" target="_blank">

On clicking on the input box I am redirected to my website but it gives me an error "Invalid form key. Please refresh the page". I have an idea why this error is generated. This is because magento generates a key for forms and that is getting expired in our case.
This is my form's html in email template
<form class="form subscribe" novalidate="novalidate" action="www.magento.com/newsletter/subscriber/new/" method="post" id="newsletter-validate-detail">

          <input name="email" type="email" id="newsletter" placeholder="eg. sam@textrti.com" data-validate="{required:true, 'validate-email':true}" style="width:368px; height:32px;">

      <button class="action subscribe primary" title="Subscribe" type="submit" aria-label="Subscribe" style="float: left; background: red;border: navajowhite;color: #fff;padding: 8px 26px 8px 26px; font-size:18px;">Subscribe
      </button>

</form>

Could someone guide me how I can solve the invalid form key error so that users are able to subscribe to my website through the subscribe button send to them in emails.


texts: Magento 2 How to add extra validation to check out address form?

texts: I want to add a validation to the address form in checkout step to ensure the address input is alphanumeric and ensure the input phone number is numeric. How to add the validation? Thanks


texts: While trying to delete address its redirecting to 404 page in Magento 2

texts:
When I try to delete additional address in Magento 2 customer dashboard its redirecting to 404 Page. My URL format mentioned below.

/customer/address/delete/id/13/form_key/xkTKVSSxqip79bZ1


texts:
I need to add compare and wishlist link in to the 1column.phtml file. I added this code in this page but nothing show!!!

app/design/frontend/default/celebrity/template/page/1column.phtml

For compare link:

<?php $_product = $this->getProduct(); ?>
            <?php if ($_compareUrl = $this->getAddToCompareUrl($_product)): ?>
                <a href="<?php echo $_compareUrl ?>" class="link-compare"><?php echo $this->__('Add to Compare') ?>
<?php endif; ?>

For wishlist link:

<?php if ($this->helper('wishlist')->isAllow()) : ?>
    <a href="<?php echo $this->getAddToWishlistUrl($_product) ?>" class="link-wishlist"><?php echo $this->__('Add to Wishlist') ?>
<?php endif; ?>

How can I fix this problem?


texts: How to add custom block link to email template and link hit from email to specific page?


texts: Error when adding to cart 'No such entity with id = 0'

texts:
When I add a product to my cart I get the following error:

No such entity with id = 0

This happens with every product in the store, can anyone help point me in the right direction?


texts:
I am trying to redirect to custom URL by using plugin feature of Magento 2 but somehow I am not able to redirect it. For this, I tried a couple of options like,

  Magento2: redirection from Observer

  Magento2: Redirect Using Plugin (With Website Restrictions ON)

But couldn't succeed with this. I am able to do it If I am adding exit(); after redirect method but it is not good practice to write exit();. Do anyone have some hint on this?

I am using around plugin and before plugin

I have written a plugin on Magento\Customer\Model\AccountManagement class.

Thanks


texts: Configurable attributes dependent on previous attribute selected

texts:
I'm curious to see if Magento supports a product setup I have in mind. I don't think it does natively, but it would be good to hear some ideas and possibly an extension that already does this. It deals with designing a configurable product that has several configurable attributes whose options are dependent on the previously selected option.

For this example, let's use Shirt. Shirt has configurable attributes: color, size, design, design orientation, and wash style. The possible option combinations are as follow:

Black | S, M | [No design]     | [No Design Orientation]
Black | L    | Designs A, B, C | Portait Orientation (for Design A only), Landscape Orientation (for Design B and C) only
Black | XL   | Pre-washed, Frayed (note: this is a XL-specific option)

As shown above, Shirt in Black can be purchased in sizes S and M. When a user selects these size options, he should not see anymore option selections and be able to add to cart. If a user selects size L, however, he should be shown further options. So, if Design A is subsequently selected, Portrait Orientation option would be available but not Landscape. Now, if a user selects XL, he gets a completely different subsequent option.

I would think I'd go with configurable-simple product setup where simple products are composed of all possible options I have shown above in the back-end. On the front-end, I would probably have some Javascript that will hide and/or fill out values for the options (in case for sizes S and M that do not need further option selection). However, I still see some issues with this.

There are going to be so many simple products. I have created products with custom options before to avoid having large simple product sets, but issues 2 and 3 below are not covered (I think) with custom options.
All of the simple products belonging to Shirt will have the same set of attributes even though simple products with size S won't need any more other configurable attributes, for example. I don't want these specific sizes to have values like N/A or None for Design and Orientation.
[PLEASE IGNOTE THIS ITEM; I LEFT IT HERE FOR RECORD] I'm not even sure if I can incorporate size XL's scenario, where the subsequent option is completely different from the other sizes.

Any thoughts?


texts: Programmatically set different price on different website for a product

texts:
I have set catalog price scope as Website in my store configuration to add different prices for different websites.

Now I am creating products using script which contains price data per website, but I am not able to store different prices for different websites scopes.

I am using below code. Using Reference

$product // << My Product Object
$availableWebsites // << Available Websites for product

foreach($availableWebsites as $websiteId){
    foreach($attributesDataArray as $storeId => $storeData){ // Loop through all available Stores
        $product->setStoreId($storeId);
        $product->setPrice($price); // Set My price. Different for each website
        try{
            $product->save();
        }catch(\Exception $e){
            throw new \Exception($e->getMessage());
        }
    }
}

But the price is stored the same for each website scope.
Any help is appreciated. Thanks.


texts: Magento(1.9.1.0) whole breadcrumb not showing, only home breadcrumb is showing

texts: I have a custom module which has the templates and I want to display the breadcrumb on a page. The fields are highlighted in the image in which I want to display breadcrumb. For e.g., I have a link https://link.com/parth-valves-and-hoses-llp/contact-us and I want the breadcrumb like this Home >   Bazar Directory >   Parth Valves and Hoses LLP >  Contact Us.


texts: How to insert data to custom table using repository method in magento 2?

texts:
I have a custom table in the custom module, Which is used to save some customer data in the sales_order_after events in the observer.
I want to know how to save the data using the Repository method.
How can I inject the repository method to my observer?
The question is a little bit vast and tried several ways and no success, Please help me.


texts: External Request - Invalid Form Key Magento 2.3

texts:
I sent a “POST” request via external server for version magento-2.3

My internal Magento URL cannot verify and response is

  "Invalid Form Key. Please refresh the page."

as a summary, i want to reach to magento-2.3 from outside and is there any valid way to do it ?

Additional information

I'm planning to build a payment module for my Magento store,
So my PSP working with this way;

When the customer clicks pay button of javascript embeded payment form, my PSP POSTing a value to my provided callbackUrl which is my controller inside of my module. (So I'm expecting a POST value to my controller.

  It looks like this:  https://mywebsite.com/mymodule/response).

When I'm trying to grab the value  with this code piece
($postData = $this->getRequest()->getPostValue(); $postData['token']).

When I'm trying to do this, Magento is requesting a value named "form_key". In earlier version there was no usage like this. I'm suspecting there is a change in the Magento 2.3.0.

Can you help me ?


texts: How to get region_id value inside collectRates method from shipping module : Magento2

texts:
I am working on shopping cart custom shipping method.
I am using the following link http://inchoo.net/magento-2/creating-a-shipping-method-in-magento-2/.

estimate-shipping-method ajax call having region_id and I need that value inside collectRates() method.


texts: Work with custom product attribute without loading the product object itself

texts:
I need to manipulate a custom product attribute for almost all products in the database. Right now I have this:

$productsCollection = Mage::getModel('catalog/product')->getCollection();

        foreach ($productsCollection as $_product) {
            $product = Mage::getModel('catalog/product')->load($_product->getEntityId());
            if ($product->getCustomizableonly() === null) {
                $product->setData('customizableonly', 0)->getResource()->saveAttribute($product, 'customizableonly');
            }
        }

But the products are more than 2000 and therefore I don't want to load the product object itself, but to work just with the product object instance from the collection. The problem is that this obj. instance contains only 1/9th of the whole Data of the product object itself. And the 'customizableonly' attribute is NOT part of that 1/9th.

How can I access the attribute without making unnecessary object loading. Or in general - how can this code be optimized to maximum, so it is not dramatically slow in case of 2000+ products?


texts: How to make not show 'As low as $'? - Magento2

texts:
I just update a product's price but on front-end page, the old price show up like 'as low as $'

I don't want to show old price as the way Why this feature is needed? How to make it not show?

Thanks!


texts: Invalid Form Key. Please refresh the page, admin login

texts:
I keep getting Invalid Form Key. Please refresh the page when i try to login into my admin account in the back-end.

I have, cleared all my cache both in magento_root/var/cache and in my browser i also have deleted the cookie path and domain web/cookie/cookie_path values in core_config_data table

I removed the data in var/sessions also as its a website currently in staging the last thing i did was install a blog plugin AW Blog and it worked with no errors and the last time i logged in successfully was last night so 12 hours ago


texts: how to show live chat option in magento when support team is online

texts:
I am developing my website in magento, I want to add live chat option if my support team is online.so how can i do that task.
also suggest which is best extension for live chat in magento


texts:
Please correct the XML data and try again. Element 'referenceBlock':
  This element is not expected. Expected is one of ( referenceContainer,
  container, update, move ). Line: 1

I got this error while trying to remove page title through Design -> Layout Update XML

This the code I used to remove block:

<referenceBlock name="page.main.title" remove="true"/>

referenceContainer works fine but problem only with referenceBlock


texts: RuntimeException when Upgrading Magento 2

texts:
I've not done an awful lot with M2 yet, I'm a sysadmin guy, but I've been dropped in it a little this week with a colleague off sick.

Anyway.  I need upgrade a M2 site.  First to 2.0.16 and then to 2.1.9.  The 2.0.16 upgrade went fine but the 2.1.9 upgrade isn't working for me.  When I run the upgrade through composer I get...

[RuntimeException]
Class Companyname\Modulename\Model\Rewrite\Customer\Classname does not exist

Now I'm pretty sure that this is a bespoke module that was developed for the client, but that's all I know.  Do I need to update something to tell M2 it will work for that version?

I've tried clearing cache, resetting permissions and whatever else I could find whilst searching, but nothing fixes the issue.

Many thanks in advance.


texts: Magento Fatal error: Out of memory (allocated 5505024) (tried to allocate 8717 bytes) in /public_html/lib/Zend/Cache/Backend/File.php on line 962

texts:
My Magento website is giving me the following error:

  Fatal error: Out of memory (allocated 5505024) (tried to allocate 8717
  bytes) in /public_html/lib/Zend/Cache/Backend/File.php on line 962

or

  Fatal error: Out of memory (allocated 10747904) (tried to allocate
  1280 bytes) in
  /public_html/app/code/core/Mage/Core/Model/Translate/Inline.php on
  line 258

etc.

The website worked fine for 3 years. This problem occurred in the last 2 weeks.

What sould I do?


texts: Installing pwa on magento throws environment error

texts:
Hi am trying to install pwa on my local but when i run command yarn install it throws this error
application@8dc8200cdd5a:/app/pwa-studio$ yarn install
yarn install v1.22.5
$ node -e 'process.env.CI||process.exit(1)' || npx npm-is yarn
npx: installed 1 in 2.636s
[1/5] Validating package.json...
[2/5] Resolving packages...
success Already up-to-date.
$ node scripts/monorepo-introduction.js
You may see a number of warnings above about unmet peer dependencies. There is nothing wrong; this is an issue with peerDependencies and Yarn monorepos.
The issue is being tracked at https://github.com/yarnpkg/yarn/issues/5810 and this notice will be removed when an upgrade to Yarn fixes this bug.
Preparing packages...
Ensuring valid environment...
/usr/bin/env: ‘node\r’: No such file or directory

error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/install for documentation about this command.

is there any fix for this am using windows system and running magento 2.3.3 over docker


texts: Error during product-collection because of already existing ID

texts:
The following code should retrieves all products in categeroy 3,11,31 and 8.

$collection = Mage::getModel('catalog/product')->getCollection()->joinField('category_id','catalog/category_product','category_id','product_id=entity_id',null,'left')
->addAttributeToSelect('*')
->addAttributeToFilter(array(array('attribute'=>'category_id',array('in' => array("3","11","31","8")))));

but it generates the following error:

Fatal error: Uncaught exception 'Exception' with message 'Item (Mage_Catalog_Model_Product) with the same id "350" already exist' in /home/huisent/public_html/staging/lib/Varien/Data/Collection.php:373 Stack trace: #0 /home/huisent/public_html/staging/app/code/core/Mage/Eav/Model/Entity/Collection/Abstract.php(265): Varien_Data_Collection->addItem(Object(Mage_Catalog_Model_Product)) #1 /home/huisent/public_html/staging/app/code/core/Mage/Eav/Model/Entity/Collection/Abstract.php(1055): Mage_Eav_Model_Entity_Collection_Abstract->addItem(Object(Mage_Catalog_Model_Product)) #2 /home/huisent/public_html/staging/app/code/core/Mage/Eav/Model/Entity/Collection/Abstract.php(871): Mage_Eav_Model_Entity_Collection_Abstract->_loadEntities(false, false) #3 /home/huisent/public_html/staging/lib/Varien/Data/Collection.php(752): Mage_Eav_Model_Entity_Collection_Abstract->load() #4 [internal function]: Varien_Data_Collection->count() #5 /home/huisent/public_html/staging/advertentieFeed/test3.php(61): count(Object(Mage_Catalog_Model_Resour in /home/huisent/public_html/staging/lib/Varien/Data/Collection.php on line 373

It turns out that product with id=350 occurs in 2 of those categeries and that's not allowed/working in Magento. Is there a way to retrieve all the products anyway?


texts: Magento - getShippingPreFee($cost) to show on available.phtml

texts:
I am adding fee's to my shipping cost on Mage_Shipping_Model_Carrier_Abstract in local.

I am adding them at the public function _getPerpackagePrice
I am having it return the $cost + fees basically. Once this is done the shipping then includes the Fee's.

protected function _getPerpackagePrice($cost, $handlingType, $handlingFee)
{
    if ($handlingType == self::HANDLING_TYPE_PERCENT) {
        return ($cost + ($cost * $handlingFee/100)) * $this->_numBoxes;
    }

    //MY CODE CALCULATIONS HERE
    if ($path_current !==$cartPaths){
       return ($cost_c  +$sub_c+$handling_c+$tax_c + $cost + $fee + $mattress_cost_c);
    }
}

But on checkout/onepage/shippping_method/availabile.phtml I want to just simply echo the variable $cost from Mage_Shipping_Model_Carrier_Abstract since its the shipping prior to the fee.

public function getShippingPreFee($cost){return ($cost);}

If someone know how to get $cost from the abstract Mage_Shipping_Model_Carrier_Abstract and echo it on checkout/onepage/shippping_method/availabile.phtml thats is what I am looking to do. I already know about putting the Return prior to the $fees on total/abstract.php and thats not my goal.


texts: What are the equivalents of magento 1.x models in magento 2.x

texts:
I am new to magento2 and I am finding it very difficult to get the regular code snippets right in the new version. So, please help me out here and explain the equivalents of the following snippets in magento2:

Mage::getModel('catalog/product')->getCollection();
Mage::getModel('sales/order');
Mage::getModel('catalog/category')->getCollection();
Mage::getModel('customer/customer');
Mage::getModel('cart/quote');
Mage::getModel('checkout/cart');
Mage::getSingleton('customer/session');
Mage::getModel('catalog/category')->load(id);

I hope this question will help all the new magento 2 developers to find relative queries all at one place.


texts: get Store ID in custom validator - Magento 2

texts:
I'm creating a custom validator for the checkout process following Magento 2 Documentation for this topic, but now I need to send the Store ID as a parameter of my custom validator, something like:

define(
[],
function () {
    'use strict';
    return {
        /**
         * Validate something
         *
         * @returns {boolean}
         */
        validate: function(storeId) {
            if(storeId !== 1) return true;
            return false;
        }
    }
});


texts: Magento 2 disappearing elements in production

texts:
Has anyone else had issues with images and other elements disappearing from Magento 2 in production? I'm currently running Magento version 2.3.2. I've noticed time and time again that the category and product detail page (product) images keep disappearing.

I've also noticed other elements inside of the admin area disappearing as well. See image:

I also noticed that when the PDP image disappears the actual image element isn't even loaded. I've made sure my folder and file permissions are right and tried running php -f bin/magento cache:clean thinking it was a caching issue but to no avail.

Any thoughts?


texts:
if we click on button, we want to redirect to this url
 , we are using below code to pass the url , but we are getting 404 error in console

is this proper way to pass the url ?

url="<?php echo Mage::getbaseUrl()?>customized-mobile-cases/customcase/ajax";

complete script

function geturlandredirec()
{
    var brand=$('brand_select').value;
    var model=$('model_select').value;
    array = [brand, model];
    alert(array)
    url="<?php echo Mage::getbaseUrl()?>customized-mobile-cases/customcase/ajax";
    new Ajax.Request(url, {
        method: 'POST',
        onFailure: function(response){
        },
        parameters: {
            brand: brand,
            model: model
        },
        onSuccess: function(response) {
            window.location = response.responseText
            return ;
        }
    });
}

controller

class Company_Brand_CustomcaseController extends Mage_Core_Controller_Front_Action
{
    /**
     * Displays the Brand list.
     */
    public function indexAction()
    {
        $this->loadLayout();
        $breadcrumbs = $this->getLayout()->getBlock('breadcrumbs');
        $breadcrumbs->addCrumb('home', array(
            'label' => Mage::helper('cms')->__('Home'),
            'title' => Mage::helper('cms')->__('Home Page'),
            'link'  => Mage::getBaseUrl()
        ));
        $breadcrumbs->addCrumb('brand', array(
            'label' => $this->__('Brand'),
            'title' => $this->__('Customcase')
        ));
        $this->renderLayout();
    }

    public function ajaxAction()
    {
        $brand=$this->getRequest()->getParam('brand');
        $model=$this->getRequest()->getParam('model');
        $products = Mage::getModel('catalog/product')->getCollection()
            ->addAttributeToSelect('*')
            ->addAttributeToFilter('brand', $brand)
            ->addAttributeToFilter('model', $model);
        $products->getFirstItem();
        echo $_product_url = $products->getProductUrl();
    }
}


texts: Magento 2: Is it possible to add search column in ui component?

texts: How can I add filter row in customer grid just like fixed PHP grid using UI component? I don't want to change any other things of UI component grid.


texts:
Im going crazy here. Can't get this to work. I'd like to make a custom page layout like the 1column, 2columns-left etc.
I've searched and read multiple tutorials all doing the same. Nothing works though. I've got the below code. Am I overlooking something maybe?

Many thanks if you guys could help me with this.

Vendor: Experius

Theme: aras

* Step 1: Define custom page layout:*

app/design/frontend/Experius/aras/Magento_Theme/layouts.xml

<?xml version="1.0" encoding="UTF-8"?>
<!--
/**
 * Copyright © 2016 Magento. All rights reserved.
 * See COPYING.txt for license details.
 */
-->
<page_layouts xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/PageLayout/etc/layouts.xsd">
    <layout id="splash-page">
        <label translate="true">Splash page</label>
    </layout>
</page_layouts>

Step 2: Define page layout of custom page layout

app/design/frontend/Experius/aras/Magento_Theme/page_layout/splash-page.xml

<?xml version="1.0"?>
<!--
/**
 * Copyright © 2016 Magento. All rights reserved.
 * See COPYING.txt for license details.
 */
-->
<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_layout.xsd">
    <update handle="empty"/>
</layout>

Step 3: Add new block to custom page layout page wrapper container

app/design/frontend/Experius/aras/Magento_Theme/layout/default.xml

<?xml version="1.0"?>
<page layout="splash-page" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd">
    <referenceContainer name="page.wrapper">
        <block class="Magento\Framework\View\Element\Template" before="-" name="splash.backgroundimage.container" template="Experius_ContentPage::html/backgroundimage-container.phtml" />
    </referenceContainer>
</page>


texts:
I'm using Magento EE 2.2.5

I need to get the product url of a product with its category path.

Presently, I'm using the code

$product_url = $product->getUrlInStore();

And also tried with

$product_url = $product->getProductUrl();

I'm getting like: www.domain.com/product_url_key

But I need to get it like: www.domain.com/category_level_1/category_level_2/product_url_key

So is there any default function to get that?


texts: Magento2: How to apply charges on multi pick-up address in FedEx?

texts:
I have added FedEx shipping method and I want to apply charges on multi pick-up address in FedEx shipping method.

Suppose one customer order 2 products and it is pick-up location also different then charges apply pick-up location wise.

I have discussed with FedEx support team he said you can apply multip pick-up charges on one order to the customer using API.

Anyone can tell me how to customize FedEx API?

My Magento v2.0.17


texts: Magento2 Make checkbox checked by Default in CHeckout page

texts:
I want to make the Checkbox checked by Default in checkout page. I have used below code it is displaying the Checkbox but it is not checked by Default, Can you please suggest where i was wrong.

 $jsLayout['components']['checkout']['children']['steps']['children']['shipping-step']['children']
                    ['shippingAddress']['children']['shipping-address-fieldset']['children']['newsletter_subscribe'] = [
                'component' => 'Magento_Ui/js/form/element/abstract',
                'config' => [
                    'customScope' => 'shippingAddress',
                    'template' => 'ui/form/field',
                    'elementTmpl' => 'ui/form/element/checkbox',
                    'options' => [],
                    'id' => 'delivery-date'
                ],
                'dataScope' => 'shippingAddress.newsletter_subscribe',
                'label' => $label,
                'provider' => 'checkoutProvider',
                'visible' => true,
                'checked' => 'checked',
                'validation' => [],
                'sortOrder' => 250,
                'id' => 'newsletter-subscribe'
            ];


texts:
I have a two Magento site both running on M2.3

On one site product details page images are served from pub/media/product. In this case the product images return 404 error. When I check, the product images are saved in pub/media/catalog/product

In the second website the images are served from pub/media/catalog/product which seems to be correct.

The 2 websites use the same theme ultimo.

So why does the first website use wrong image URLs?

Thanks for your help.


texts: I am unable to put a conditional promo code for SKU. While I am selecting the SKU attribute it's showing "is assigned" or "not Assigned" instead of putting a particularity SKU code. Can anybody help to figure out this?


texts: how to set the config cache options to 0 all columns

texts:
we are facing " No data recieved error in our site "

here they gave solution as :

1)disable compilation : php -f shel/compiler.php -- disable
2)set the configcacheoptions to 0 all columns

I want to know what is mean by

set the configcacheoptions to 0 all columns

system.log :

XML declaration allowed only at the start of the document  in /var/www/html/site/lib/Varien/Simplexml/Config.php on line 510

exception.log :

exception 'Mage_Core_Exception' with message 'Invalid block type: ' in /var/www/html/site/app/Mage.php:595
Stack trace:
#0 /var/www/html/site/app/code/core/Mage/Core/Model/Layout.php(495): Mage::throwException('Invalid block t...')
#1 /var/www/html/site/app/code/core/Mage/Core/Model/Layout.php(437): Mage_Core_Model_Layout->_getBlockInstance('', Array)
#2 /var/www/html/site/app/code/core/Mage/Core/Model/Layout.php(472): Mage_Core_Model_Layout->createBlock('', '')
#3 /var/www/html/site/app/code/core/Mage/Core/Model/Layout.php(239): Mage_Core_Model_Layout->addBlock('', '')
#4 /var/www/html/site/app/code/core/Mage/Core/Model/Layout.php(205): Mage_Core_Model_Layout->_generateBlock(Object(Mage_Core_Model_Layout_Element), Object(Mage_Core_Model_Layout_Element))
#5 /var/www/html/site/app/code/core/Mage/Core/Model/Layout.php(210): Mage_Core_Model_Layout->generateBlocks(Object(Mage_Core_Model_Layout_Element))
#6 /var/www/html/site/app/code/core/Mage/Core/Controller/Varien/Action.php(344): Mage_Core_Model_Layout->generateBlocks()
#7 /var/www/html/site/app/code/core/Mage/Core/Controller/Varien/Action.php(269): Mage_Core_Controller_Varien_Action->generateLayoutBlocks()
#8 /var/www/html/site/app/code/core/Mage/CatalogSearch/controllers/ResultController.php(77): Mage_Core_Controller_Varien_Action->loadLayout()
#9 /var/www/html/site/app/code/core/Mage/Core/Controller/Varien/Action.php(418): Mage_CatalogSearch_ResultController->indexAction()
#10 /var/www/html/site/app/code/local/Mage/Core/Controller/Varien/Router/Standard.php(250): Mage_Core_Controller_Varien_Action->dispatch('index')
#11 /var/www/html/site/app/code/core/Mage/Core/Controller/Varien/Front.php(172): Mage_Core_Controller_Varien_Router_Standard->match(Object(Mage_Core_Controller_Request_Http))
#12 /var/www/html/site/app/code/core/Mage/Core/Model/App.php(354): Mage_Core_Controller_Varien_Front->dispatch()
#13 /var/www/html/site/app/Mage.php(684): Mage_Core_Model_App->run(Array)
#14 /var/www/html/site/index.php(89): Mage::run('', 'store')
#15 {main}


texts:
Trying to enable all products based on category.
I have category id = 14. Went into MySQL PHPMyAdmin and fetched all products from that category:

SELECT * FROM catalog_category_product where category_id=14
And then I am not sure what to do with it since the products within this table don't contain a column with enabling or disable options in it.

Is there other tables I could look int? using Magento 1.9


texts: Magento 2 optimize performance by separating static element and cache

texts:
I'm drafting the system diagram of my site. I'm planning to use multiple servers 4 apache servers, 2 db servers and 2 file server for performance enhancement.

As Magento has many cache files and media files. I decided to put media files into file servers for speed and easy management. But for cache files, I'm still thinking should I put them into file servers.

Anyone can give some suggestion? Many thanks.


texts: Hide particular payment method if subtotal is zero

texts:
We want to hide particular payment method if subtotal is zero.

We are giving 100% discount for some products, so that if customers try to buy those products, then I want to hide some custom payment method [code: hdfc]


texts: Timezone in email Invoice is different than than store

texts:
Timezone set in the backend - http://prntscr.com/44ti3x

But timezone showing in email invoice - http://prntscr.com/44tin0

How can I change this to IST ??


texts: Payment option disappears when changing address during checkout

texts:
I have a very strange issue with my checkout page. When I order something and don't change the address or anything I get all my payment options like this:

But when I go a two steps back, and change the shipping address to anything different and then go back to my payment options, it looks like this:

The afterpay option is gone.

What could be causing that? There is no option that is related to this in my backend so it must be a bug of some sort. I am running magento 1.9


texts:
I'm trying to remove the ?___store=default from the url of a page of my Magento store. I tried pretty much all the solutions including changing the .htaccess. How do I do this?

I've tried adding a redirect to my htaccess and changing the 'Add Shop Code to URLs' to Yes in System -> Configuration -> Web -> URL options


texts:
I have a problem with the magento cms. The perfect solution would be to have widgets nested in another widgets (similar approach like TYPO3 FCEs). I've got a lot of problems with escaping, editing and saving this deeply nested structure. Is there a better way to accomplish this? What I actually want is to create elements with a certain html frame with the possibility to insert another elements of the similar kind. You can think about it as of bootstrap elements, where I want something like row-element containing col-elements containing other elements. I know, that it can be done with static blocks, but the usability is quite poor.

Would appreciate any ideas or suggestions!


texts: No Inode space!; How to delete Magento sessions folder's contents?

texts:
Hopefully, someone can help me,

A Magento website I'm managing keeps going down, I've determined it to be the fact that it has used up all of the Inode space on the server.

The output to df -i is below..

/dev/vda1 3932160 3932160 0 100% /
none 506035 2 506033 1% /sys/fs/cgroup
udev 503322 402 502920 1% /dev
tmpfs 506035 323 505712 1% /run
none 506035 4 506031 1% /run/lock
none 506035 1 506034 1% /run/shm
none 506035 2 506033 1% /run/user

As you can see it is quite clearly the top one with the problem. As it's a Magento site, I do have a feeling it's the var/session folder. I have changed to it's directory within PUTTY (the session folder) and typed in 'ls' and the list seems to go on forever. I should delete them all, no?

So my file system is out of inodes.. and the session folder I believe is the culprit, How can i go about resolving this? I.e what code do i input to delete said session files?


texts: How to Change Product Images with external Image url in all magento 2 frontend and Backend Image display?

texts:
I want to change Product Images to external Image URL in Magento 2 Frontend.

Product Listing Page.
Product Details Page Gallery.
Related Products.
Upsell Products listing.
Cross Sell Listing.
All Product Widget.
Cart Page and Minicart as well as in checkout Page.

On admin side I want to change Product Image in grid column.

Please help me To do this.

Thank you.


texts: How to create custom Contact Us page in Magento 2 (Claue)

texts:
This question/topic is not directly related to Magento, but a 3rd party theme (Claue). Now I know I should contact their support, unfortunately they are replying very late and I already did contact them but ever since (3 days) I have been waiting. Therefore, I thought of getting help from developers who (possibly) might have worked with Claue Theme.
I installed Magento without sample data, then installed Claue theme. But I see no contact us page. Unfortunately, in their documentation there is no details about this issue or solution, creating custom pages. So, I created new contact page from "admin > content > pages" but now I am stuck as how do I get claue contact-us form or Map API.
Currently my contact us page looks like:


texts: How to create different product page layout based on different phtml file in magento2 Product page

texts:
I want to display different phtml file on simple product based on page layout while choosing from -(catalog-Product-design section) .
Can any one help me with this on how to achieve this.  thanks in advance


texts: What is minimum / recommended RAM size for Redis when used as Magento Cache?

texts:
I want to move the Magento cache to Redis.

How much RAM memory is needed for Redis to support this scenario?. I assert no SWAP usage. Somehow I cannot find any recommendations in the documentation.

Does that depend much on the number of products? If so do you know how much I need for 1000 products, 100k products, and 1M products?


texts: After deleting files under 'view_preprocessed' folder they dont appear again when reloading site

texts:
I'm testing some small LESS changes in my theme. After every change I delete the contents inside:

pub/static/frontend/mytheme

and

var/view_preprocessed

Then I reload my site and the contents of var/view_processed (css and source folders) are not created so the new LESS changes aren't applied. However the site loads fine with the previous LESS settings.

After visiting 10-15 pages the css and source folders are created again and I can see my changes finally.

I constantly delete the Magento cache so thats not the issue. I've also set Firefox and Chrome to not save cookies, history, etc. Permissions have been set to 777 to discard that possible cause.

Why dont the contents of var/view_preprocessed folder get created right after the first reloading of my site?


texts: Magento 2.3 - Move billing address below shipping address in checkout

texts:
I want to move the billing address form below the shipping address in the checkout, on the first page/step.

Therefore I created a custom module with the following LayoutProcessorPlugin.php.

But now the billing address field is displayed above the shipping address instead of below. And the default checkbox 'My billing and shipping address are the same' is now unchecked by default.

Also the line to remove the billing address on the billing step is not working. So now this is displayed on both places.

EDIT:

We also tried to use the Tigren method (https://www.tigren.com/billing-under-shipping-address-m2/) or the SR module (https://github.com/sohelrana09/modified-checkout). But these both have the same problem, the prefix is changed into an input field, instead of a select field. So it does not match the options from the backend anymore.

Image of the prefix input field (should be a select with values from backend):

Any idea how to solve this issue?

My LayoutProcessorPlugin.php code;

<?php

namespace Redable\ReorderBillingForm\Model\Checkout;

class LayoutProcessorPlugin
{

    /**
     * @param \Magento\Checkout\Block\Checkout\LayoutProcessor $subject
     * @param array $jsLayout
     * @return array
     */

    public function afterProcess(
        \Magento\Checkout\Block\Checkout\LayoutProcessor $subject,
        array $jsLayout
    )
    {
        // get billing address form at billing step
        $billingAddressForm = $jsLayout['components']['checkout']['children']['steps']['children']['billing-step']['children']['payment']['children']['afterMethods']['children']['billing-address-form'];

        // move address form to shipping step
        $jsLayout['components']['checkout']['children']['steps']['children']['shipping-step']['children']['billing-address-form'] = $billingAddressForm;

        // remove form from billing step
        unset($jsLayout['components']['checkout']['children']['steps']['children']['billing-step']['children']['payment']['children']['afterMethods']['children']['billing-address-form']);

        return $jsLayout;
    }
}


texts: Big problem with error SQLSTATE[HY000] [2006] MySQL server has gone away

texts:
For the last 4 days, somebody is constantly attacking my website , making it to go into SQLSTATE[HY000] [2006] MySQL server has gone away error.
What he does basically is open up multiple pages , adds to cart several products, and/or adds to compare list.
Then the site overloads and it goes dead, giving me the MySQL error.
In addition, in WHM (i use a VPS) i have Server Load    27.39 (2 CPUs) which is very high.
Every time, the hosting company has to kill his proceeses and ban his ip (which is constantnly changing). The requests on the server look like this :

supergeneratoare.ro:80 GET /putere?dir=desc&limit=all&order=price HTTP/1.1
supergeneratoare.ro:80 GET /catalog/product_compare/remove/product/401/uenc/aHR0cDovL3
supergeneratoare.ro:80 GET /catalog/product_compare/remove/product/362/uenc/aHR0cDovL3
supergeneratoare.ro:80 GET /checkout/cart/add/uenc/aHR0cDovL3d3dy5zdXBlcmdlbmVyYXRvYXJ
supergeneratoare.ro:80 GET /catalog/product_compare/remove/product/406/uenc/aHR0cDovL3
supergeneratoare.ro:80 GET /checkout/cart/ajaxDelete/id/3833/uenc/aHR0cDovL3d3dy5zdXBl
supergeneratoare.ro:80 GET /catalog/product_compare/remove/product/375/uenc/aHR0cDovL3

Now, i removed the add to compare function and add to cart function, and for a day it was good, but now he found a way to do it again, site is down again.

Can anybody help me with this ? Nor my programmer,nor the hosting company support  don't know what's going on .


texts: Magento 1.5 - Sales > Order > edit order and shipping methods disappear

texts: When i am editing order in Magento 1.5 and change price then click on “Update Item and Qty’s” button the shipping method disappear. Instead of shipping methods there is a link “Get shipping methods and rates”, but when I click it nothing's happend - page reloads and still there are no methods. what is wrong with it?


texts: System Settings > System Upgrade link does not exists

texts: I am trying to update to the latest version of Magento from 2.2 and want to do it from the admin panel. However the System Upgrade link under system doesn't exist. Did I mess something up with my install? I have only one account with this system and it is admin. I am using the install to run m2e so everything is basic settings.


texts:
Can you help me on small project in MEDISON ISLAND go to on page go to on a "SALE" on drop down, click on "MEN". Here in below the product image how I can placed "add to cart button, and when click on  button, the product  should be add into cart.
Please help me step by step, and also suggest me for free book to understand or download. I am entry level in magento.


texts: Set custom order status - Dependant on delivery method

texts:
I am wondering how I can set a order status that is driven by the delivery method chosen by a customer.

Currently I am using magentos "Free Delivery" option which I have labelled as "Collect In Store".

If someone uses this delivery option and pays for an item the order is set to "Complete". What I want is for the order to be set to "Ready for Collection" until someone manually sets it to complete once a customer has collected it.

Does anyone know of a way of doing this?


texts: Magento 2 catalog category link widget is not working

texts: I wanted to insert catalog category in my content, however, it keeps showing a broken image whenever I try to use it. I have also tried manually coding it. Does anyone know the fix for this?


texts:
I'm trying to set a time in the product special price to/from dates (i.e., special price from 3/20/2013 11am EST to 4/20/2013 10:59am EST), but I cannot get a time to show up or save.

When I enter a time in the admin (for example, 03/20/2013 11:00:00), it always shows up with 00:00:00 in the database. I don't really need to update the admin to allow showing the time in the calendar widget; rather I just need it to save if I put in a time.


texts: New Order email template | Add price of each product including and excluding tax

texts:
I am trying to make my "New Order" email template to look like in the image below:

I want to include "Price" of each item excluding and including tax. Same applies to the subtotal.
Here is the current state of my "New Order" email template:

I believe, I need to change the items.phtml file located in /app/design/frontend/base/default/template/email/order/items.phtml. Am I even looking in the right place?


texts: what is the xml tag for "sign up for price alert", "add to wish list" and "share"?

texts:
What are the xml tags for the following links on the product page?
sign up for price alert, add to wish list and share


texts:
Here's my problem.
I have a tabs block which load perfectly when I put this script in phtml

require([
            'jquery',
            'jquery/ui'
        ],
        function($) {
            $("footer").tabs();
        }
    );

But if I use $("footer").tabs(); in browser console, tabs are not working.
Every other components of jQuery ui works fine except this one.

Did I miss something ?


texts: Display category image in product view gallery

texts:
I want to display the category image as product image.
So I put this code to my Observer:

$product = $this->_registry->registry('current_product');
$product->addImageToMediaGallery('catalog/category/test.png', array('image', 'small_image', 'thumbnail'), false, false);

This doesn't work. But when I save the product:

$product->save();

He saves the images to the product permanently.
But I want to add the image only for this one request.

I tried also to manipulate the Gallery.php and XML, but then the zoom function isn't working anymore.

How can I achieve this?
Thank you


texts: Get product price if is set catalog rule (final price, sprecial price, discount price)

texts:
public function __construct(
    Context $context,
    \Magento\Catalog\Model\ProductFactory $productFactory
) {
    $this->productFactory = $productFactory;
    parent::__construct($context);
}

$products = $this->productFactory->create()
            ->setStoreId($store_id)
            ->getCollection()
            ->addAttributeToFilter('status', 1)
            ->addAttributeToFilter('visibility', '4');
foreach($products as $product)
    {
$finalprice =($product->getTypeId() == \Magento\ConfigurableProduct\Model\Product\Type\Configurable::TYPE_CODE)?
                            $product->getPriceInfo()->getPrice('final_price')->getAmount()->getValue(). ' ' . $currency:
                            $product->getFinalPrice() . ' ' . $currency;//price but not FINAL
}

I have in Catalog Price Rule some rules for products in the category. How can I get the last price? I would like to have both prices (249,00€ and 124,50€)


texts: option does not show for Text Swatch attribute

texts:
In my product attribute if Catalog Input Type for Store Owner is set as Dropdown

And then when creating a product configuration, I can see the option to add a new value:

But if Catalog Input Type for Store Owner is set as Text Swatch I can't see that option:

I am Using latest Magento version 2.4.2. Is that a bug or it is a default
behaviour(why?)? How can I solve that?


texts: Where to place custom code for admin section

texts:
I need to implement some custom functionality in admin/backend section where users have the option of creating a manual order. The main objectives are to:

Add a mini form above the option to select products to add to the order
Add a javascript file when on this page
The option of saving this form as normal or through a custom handler based on a session var set after the first form submission

I understand how to do each individual part but I could use some guidance on the best approach.

Should I create a module which contains all of this functionality? If so, is it possible using the layout file to reference the various blocks on this page and insert the custom blocks as required without calling them from the core files?

OR

Should I copy the core files to a local directory and make the changes as necessary? If so what's the best practice regarding the template files for the admin section in terms of where modified ones should go?


texts: How to know if the product qty is less than 10. Is there any alert in Magento 2.2.4?

texts:
How to show the notification in admin panel whenever the any one product's quantity is 0 as

Dear Administrator, one of the product's quantity is going to 0

How to get this ?


texts: Where can i find the create order logic code for "Submit order" button in magento 1 backend?

texts:
I can see that "order.submit()" is called from create order button but i am not sure where is the logic is located.
Issue is order does not created on first click on create order button due to that ia m trying to debug the issue.
Any thoughts where i can find the responsible file in magento 1 ?


texts: 500 Internal server error after finished paypal configuration

texts:
Im trying to setup my first magento store, im working with magento community v1.7.0.2 with custom theme and modules. Last week after finished with the payment options i worked for one hour wihtout any issue. Then i was edditing some .cvs files in order to translate some words and then i got this messege.

Fatal error: Class 'Mage_Checkout_Controller_Action' not found in xxxxx/app/code/core/Mage/Checkout/controllers/OnepageController.php on line 29

I get this messege when im on my my shoping cart webpage and press the PROCEED TO CHECKOUT button, i have tried different stuff like:

set files and directories permision
edit .htaccess file

I found some info about paypal express checkout bugs or issues with magento and custom themes but cant find anything to solve my problem. Thx in advance guys


texts: Magento 2 - Unlimited stock of a product

texts: Our products are digital goods which do not have a quantity limited. Is there a way to configure a product with a unlimited stock quantity?


texts: After Security patch supee-7405 topmenu is not displaying

texts:
I have install supee-7405 patch after than topmenu is not displaying in frontend because menu block dont have permission than when i add new premission for block gives this error

  Fatal error: Call to a member function setData() on a non-object in /app/code/core/Mage/Adminhtml/controllers/Permissions/BlockController.php on line 113

How to solve this problem


texts: Magento2 : add New address type to customer

texts: I want to Create a new address type "neighbors address / alternate address " . To assign it to customer i have created new customer attribute ( just like "default_shipping" and "default_billing" ) "alternate_address" and saved address_id against it . But how to integrate it with Quote and order . They only save a string "shipping or billing"  in address_type column . Where i would like to have it as alternate


texts: Zero subtotal payment method not showing up in one page checkout

texts:
Even though I have zero subtotal payment enabled it will not show up when one page checkout is enabled. If I disable one page checkout then zero subtotal payment is then shown as an option.

Can anyone suggest any reasons for this?


texts: Prices Zero on listing pages after update to Magento 1.9

texts:
After the upgrade from M1.8.1 to M1.9.3.8 all product prices on the category list pages an the crossselling elements where shown as 0 (Zero) with a strikethrough regular price.

On the detail page everything is fine and shown properly.

The value from getFinalPrice() is "0". We have no catalog rules applied and the product's Special Price fields are all empty (no zeros).

I already deleted the cache and reindexed everything without success.

I have to note, that we actually only have configurable products in the shop and we use multiple store views (to provide different languages). But i already checked for wrong store view overrides without success.

The same issue comes up a lot during my search, but most of the time its vice versa, Listing page is correct and Detail page is wrong. So can't find any solution yet.

UPDATE:

The issue is related to configurable products only!
The $product->getData('final_price') function returns zero, whereas the basePrice is correct.
In a blank Magento 1.9.3.9 installation on the same server everything is ok.
All modules have been updated to their latest versions. The issue still exists.


texts: Adding a custom field to Magento Newsletter

texts:
I'm trying to add a custom field to the Magento Newsletter.  The answer here by Roman Snitko looks hopeful.  But I'm not sure how to create observer for  the newsletter_subscriber_save_before event.

So I googled and found this question, and based the following code off of that.  Am I missing a file or something to make the observer work?

/app/etc/modules/Custom_Newsletter.xml

<?xml version="1.0"?>
<config>
  <modules>
    <Custom_Newsletter>
      <active>true</active>
      <codePool>community</codePool>
      <depends>
        <Mage_Newsletter />
      </depends>
    </Custom_Newsletter>
  </modules>
</config>

/app/code/community/Custom/Newsletter/etc/config.xml

<?xml version="1.0" encoding="UTF-8"?>
<config>
  <modules>
    <Custom_Newsletter>
      <version>1.0.0.0</version>
    </Custom_Newsletter>
  </modules>
 <global>
    <models>
      <newsletters>
        <class>Custom_Newsletter_Model</class>
      </newsletters>
    </models>
    <events>
      <newsletter_subscriber_save_before>
        <observers>
          <newsletters_add_types>
            <class>newsletters/observer</class>
            <method>newsletterSubscriberSave</method>
          </newsletters_add_types>
        </observers>
      </newsletter_subscriber_save_before>
    </events>
  </global>
</config>

/app/code/community/Custom/Newsletter/Model/Observer.php

<?php

Mage::log('Observer method fired', null, 'newsletter.txt');

class Custom_Newsletter_Model_Observer extends Varien_Event_Observer
{
  public function __construct(){
  }

  public function newsletterSubscriberSave($observer){
    $subscriber = $observer->getEvent()->getSubscriber();
    $zone = (string) $this->getRequest()->getPost('zone');

    $subscriber->setZone($zone);

    //$subscriber->save();
    return $this;
  }
}

I have added an input[name=zone] in the view.  I have added a field [zone] the database.  There are no errors, but the data isn't saved.  If I added a die() into the newsletterSubscriberSave function, nothing happens.

Edit: Here is the form, in case something looks strange there:

<form action="http://sites.dev/en/newsletter/manage/save/" method="post" id="form-validate">

        <input name="form_key" type="hidden" value="xOMnfzMi8WfdZV5w">

Newsletter Subscription

<input type="checkbox" name="is_subscribed" id="subscription" value="1" title="General Subscription" checked="checked" class="checkbox">General Subscription

« Back

        <button type="submit" title="Save" class="button">Save</button>

            <input type="hidden" name="zone" id="newsletter_zone" value="USA">

</form>


texts: Magento:2.3.1 How to remove loader from checkout when changing payment method

texts: How to remove the Loading functionality (loader) from the checkout steps when we change the payment method from one to another in the existed methods?


texts:
"Removing unnecessary item from top nav-menu"
Earlier for testing I'd added category called blog new and then i deleted it but now its still visible but it doesn't have any class and its disturbing the alignment of menu, how do i remove it?
I've already tried to find it but it doesn't have a class so could not find it through grep command.


texts:
How can i configure menu.xml file with uiform that i created custom.

Here's the menu code:

  /home1/dukaania/public_html/testing2/app/code/Test/Banners/etc/adminhtml/menu.xml

<?xml version="1.0"?>
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
        xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Backend:etc/menu.xsd">
    <menu>
        <add id="Test_Banners::first_level_demo"
             title="Shipping Vendor"
             module="Test_Banners"
             sortOrder="9999"
             resource="Magento_Backend::content" />

              <add id="Test_Banners::second_level_demo"
             title="Shipping Vendor Cost"
             module="Test_Banners"
             sortOrder="0"
             action="uiform/"
             parent="Test_Banners::first_level_demo"
             resource="Magento_Backend::content" />

    </menu>
</config>

Here's the routes file course:

  /home1/dukaania/public_html/testing2/app/code/Test/Banners/etc/adminhtml/routes.xml

<?xml version="1.0"?>
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:App/etc/routes.xsd">
    <router id="admin">
        <route id="uiform" frontName="uiform">
            <module name="Test_Banners"/>
        </route>
    </router>
</config>


texts:
I need to redirect customers back to the previous page when a customers get registered or log in to the account like when a customers need to add a review and need to log in to their account before making any comments. So currently Magento 2.1.6 redirects to customer account page when a customers want to review the product.

Does anyone has a solution?


texts: Product collection Sort by Custom attribute with yes/no Option

texts:
Hi I have created one attribute called archive whose type is Yes/No. So archive attribute for every product has either Yes/No.

Now I want to sort product collection so that all products whose archive value=YES should come at the end.

I tried:

$collection = Mage::getModel('catalog/product')->getCollection()
             ->addStoreFilter(Mage::app()->getStore()->getId())
             ->addAttributeToSelect('*')
             ->addAttributeToFilter('type_id', 'configurable')
             ->joinField('category_id', 'catalog/category_product', 'category_id', 'product_id = entity_id', null, 'left')
             ->addAttributeToFilter('category_id', array(
                 array('finset' => '37'))
               )
             ->addAttributeToSort('archive', 'desc');

But it does not work.

Printing $collection->getSelect() results in:

SELECT `e`.*, `cat_index`.`position` AS `cat_index_position`, `price_index`.`price`,
`price_index`.`tax_class_id`, `price_index`.`final_price`, IF(price_index.tier_price IS
NOT NULL, LEAST(price_index.min_price, price_index.tier_price), price_index.min_price)
AS `minimal_price`, `price_index`.`min_price`, `price_index`.`max_price`,
`price_index`.`tier_price` FROM `catalog_product_entity` AS `e` INNER JOIN
`catalog_category_product_index` AS `cat_index` ON cat_index.product_id=e.entity_id AND
cat_index.store_id='1' AND cat_index.category_id = '37' INNER JOIN
`catalog_product_index_price` AS `price_index` ON price_index.entity_id = e.entity_id
AND price_index.website_id = '1' AND price_index.customer_group_id = 0 WHERE
(`e`.`type_id` = 'configurable')


texts: Remove Credit Card option from magento 2 checkout

texts:
I don't want to show credit card option in Magento [2.2.2] checkout. From backend only cash on delivery is enable but still credit card is showing. Even whatever payment method i choose [Standard PayPal, PayPal Express or PayFlo pro] along with PayPal still showing Credit Card.

Can any one give me any idea or solution, why Credit Card showing on checkout when only COD enable.