texts: elasticsearch and mariadb services stop sometimes. They get up automatically in a few minutes or I do it manually but I need a permanent solution

texts:
I don't know if it's a problem with my magento(magento 2.4.1) or with my server
I found this errors in log file:
1-main.CRITICAL: Lo sentimos, algo salió mal. Encontrarás más información en el registro de errores. {“report_id”:“5a53758f00c8f6836c7b809a696d29418a204bf7755566fbca48b128872efe73”,“exception”:"[object] (Magento\Framework\Exception\LocalizedException(code: 0): Lo sentimos, algo salió mal. Encontrarás más información en el registro de errores. at /bitnami/magento/app/code/Mageplaza/LayeredNavigation/Model/ResourceModel/Fulltext/Collection.php:500)"} []
(this error i dont know why)
2- main.CRITICAL: No alive nodes found in your cluster {“exception”:"[object] (Elasticsearch\Common\Exceptions\NoNodesAvailableException(code: 0): No alive nodes found in your cluster at /bitnami/magento/vendor/elasticsearch/elasticsearch/src/Elasticsearch/ConnectionPool/StaticNoPingConnectionPool.php:50)"} []
(i know this error is when elasticsearch is stopped)
3-main.CRITICAL: Sin identidad con id = 151 {“report_id”:“a159db1bdbeb6bae1fdbd5a54f75249bc8b12e7cf716bfd718c6e05227dab1f5”,“exception”:"[object] (Magento\Framework\Exception\NoSuchEntityException(code: 0): Sin identidad con id = 151 at /bitnami/magento/vendor/magento/framework/Exception/NoSuchEntityException.php:50)"} []
(this happens because magento is looking for a category that no longer exists)
4-main.CRITICAL: The stock item was unable to be saved. Please try again. {“exception”:"[object] (Magento\Framework\Exception\CouldNotSaveException(code: 0): The stock item was unable to be saved. Please try again. at /bitnami/magento/vendor/magento/module-catalog-inventory/Model/Stock/StockItemRepository.php:187, Magento\Framework\Exception\LocalizedException(code: 0): Could not ping search engine: No alive nodes found in your cluster at /bitnami/magento/vendor/magento/module-elasticsearch/Model/Adapter/Elasticsearch.php:166)"} []
(i see this error happens when elasticsearch is stopped)
5-main.CRITICAL: SQLSTATE[HY000] [2002] Connection refused {“report_id”:“1b81cb1bc304cb27c49162710beda39c5b5776967e3451cd02091d3d63a2d063”,“exception”:"[object] (Zend_Db_Adapter_Exception(code: 2002): SQLSTATE[HY000] [2002] Connection refused at /bitnami/magento/vendor/magento/zendframework1/library/Zend/Db/Adapter/Pdo/Abstract.php:144, PDOException(code: 2002): SQLSTATE[HY000] [2002] Connection refused at /bitnami/magento/vendor/magento/zendframework1/library/Zend/Db/Adapter/Pdo/Abstract.php:128)"} []
(this error when mariadb is stopped)
thank you for your help


texts:
If I use

<?php echo "Valid until: "; echo strtolower(date('j. M. Y', strtotime($this->getPdfHelper()->getOrderDate()." +5 days")))?>

I get proper result, but month is displayed in English, not in Magento locale.

If I use

<?php echo Mage::helper('catalog')->__('Valint until')?>: <?php echo $this->getPdfHelper()->getOrderDate() + (5*24*60*60), true, $format?><br/>

Result is "Valid until: 4320031"

Any suggestion, how to add days to getOrderDate() so result will be in Magento locale, with "j. M. Y" date format?


texts: Magento 2 shipment charge split foreach loop error

texts:
I have splited orders by seller_id assigned to products using below module.
https://github.com/magestat/magento2-split-order/
I have different shipping price for different products. I have segregated the shipping charge as a array with seller_id as key. When I run in foreach loop and set shipping charges only the last array values charge is applying for both orders.
My array is:
(
    [13] => Array
        (
            [0] => 100
        )

    [15] => Array
        (
            [0] => 150
        )

)

My code below
public function recollectTotal($quotes, $items, $quote, $addresses, $products)
    {
        $tax = 0.0;
        $discount = 0.0;
        $finalPrice = 0.0;
        $total = 0;
        foreach ($items as $item) {
            // Retrieve values.
            $tax += $item->getData('tax_amount');
            $discount += $item->getData('discount_amount');

            $finalPrice += ($item->getPrice() * $item->getQty());
        }

        // Set addresses.
        $quote->getBillingAddress()->setData($addresses['billing']);
        $quote->getShippingAddress()->setData($addresses['shipping']);

        // Add shipping amount if product is not virtual.
        $shipping = $this->shippingAmount($quotes, $quote,$total, $products);

        // Recollect totals into the quote.

        foreach ($quote->getAllAddresses() as $address) {
        // Build grand total.
            foreach($shipping as $ship){
                    $grandTotal = (($finalPrice + $ship[0] + $tax) - $discount);
                    $address->setBaseSubtotal($finalPrice);
                    $address->setSubtotal($finalPrice);
                    $address->setDiscountAmount($discount);
                    $address->setTaxAmount($tax);
                    $address->setBaseTaxAmount($tax);
                    $address->setBaseGrandTotal($grandTotal);
                    $address->setGrandTotal($grandTotal);
            }
        }

        return $this;
    }

    /**
     * @inheritdoc
     */
    public function shippingAmount($quotes, $quote, $total = 0.0, $products)
    {
        // Add shipping amount if product is not virtual.
        if ($quote->hasVirtualItems() === true) {
            return $total;
        }
        $shippingTotals = $quote->getShippingAddress()->getShippingAmount();

        // If not, set shipping to one order only.
        if (!$this->helperData->getShippingSplit()) {
            static $process = 1;

            if ($process > 1) {
                // Set zero price to next orders.
                $quote->getShippingAddress()->setShippingAmount($total);
                return $total;
            }
            $process ++;

            return $shippingTotals;
        }
        if ($shippingTotals > 0) {
            // Divide shipping to each order.
            $total = (float) ($shippingTotals / count($quotes));
            $quotes = [];
            $total_splited = [];
            foreach ($products as $item) {
                $objectManager = \Magento\Framework\App\ObjectManager::getInstance();
                $product = $objectManager->create('Magento\Catalog\Model\Product')->load($item->getProduct()->getId());
                $seller_id = $product->getData('seller_id');
                $shipping = $product->getData('shipping_cost');
                $quotes[$seller_id][] = $shipping;
            }

        }
        return $quotes;
    }

In this function shippingAmount() I have segregated the shipping charge and assigned in recollectTotal() functions.


texts: I have developed magento website in version 1.9.2.4 in which footer link display in homepage only and other page footer link will hide so how can i display in another page ?


texts:
I am working with magento 1.7.0.2.
I have a problem with navigation layer. I moved the Sort by block from right to left and it work (Sort by Price) only when i have product in categories. When i don't have any product it doesn't work and the Sort by categories appears in right.

That is what i did :
 I changed in app\design\frontend\default\default\layout\catalog.xml

in Catalog Category (Anchor) i add this code :

<reference name="root">
            <action method="setTemplate"><template>page/3columns.phtml</template></action>
</reference>

and i edit this code :

<reference name="right">
<block type="catalog/layer_view" name="catalog.leftnav" before="-" template="catalog/layer/view.phtml"/>
</reference>

To

<reference name="left">
<block type="catalog/layer_view" name="catalog.leftnav" before="-" template="catalog/layer/view.phtml"/>
</reference>

What is my problem ?


texts:
Annoying issue about rounding. I think community knows it. When you use price including tax, discounts and so on you will get 0.01 price difference. I found a solution to rewrite core class with method round($price, 4) and thought it might help. It was working fine, but now I faced with it again. I have a condition for export  base_total_invoiced == base_grand_total and this prices are 112.9230 != 112.9200 I can round them also. But it's a dirty fix.

Does anybody know good solution for it?


texts:
I load and process my layout, but I have an if in my controller and, depending on the value that I need, I have to load a specific block. How can I create it?

My controller :

public function finalizeAction()
{

if (Some_if)
{

}
elseif (some_if)
{

}
elseif (someif)
{

}
$this->loadLayout();
$this->renderLayout();

}

My layout:

<?xml version="1.0"?>
<layout version="0.1.0">
    <agentdeposit_order_finalize>
        <reference name="head">
            <action method="addItem"><type>skin_js</type><name>js/finalizeorder.js</name></action>
        </reference>
        <reference name="root">
            <action method="setTemplate"><template>page/1column.phtml</template></action>
        </reference>

        <reference name="content">
            <block type="agentdeposit/finalize" name="agentdeposit_finalize" template="agentdeposit/finalize_form.phtml" />
        </reference>
    </agentdeposit_order_finalize>
</layout>

I render just finalize_form.phtml, but I want to render 4 values depending on if


texts: Add custom module Tab(gird) in admin Dashboard

texts:
I've build a custom extension but now I would like to add some data from this extension to the dashboard page. To be precise I would like to add it to the tabs you see in the image attached.

Can someone point me in the right direction on how to go about doing something like that?
Thanks in advance.


texts: Detail page - Display configurable product's thumbnail images even when an option is selected!

texts:
So let's say I have a configurable product having an option of colour with 2 values: Black, White.

I want to make the thumbnail images of the parent product stay, even when I select any colour.

Here is my parent product:

And this is my child product:

So can you guide me how to do that?
Without re-adding images.
I'm using Magento 2.2.1


texts: Blank Checkout Page after installing extension

texts:
I Installed a Marketplace extension on magento and it works well.
Except that the checkout page is now blank ( with only the logo ).
I tried debugging but i couldn't resolve it.
The one thing i found ( from template hints ) that the only file that doesn't get called is
./vendor/magento/module-checkout/view/frontend/templates/onepage.phtml
I checked the di.xml from the extension and i didn't see anything being replaced from the plugin in the checkout process.
Can anyone help me in debugging this or know what can be the problem ?
Thanks in advance.


texts:
I have added a quantity field as per http://hkpatel201.blogspot.co.uk/2014/03/how-to-add-custom-qty-to-custom-option.html

All is working well. Screenshot of the admin is http://snag.gy/H9zE4.jpg

I know the following code gets me the Option Type ID

$orderItemOptions = $orderItem->getProductOptions();
if (isset($orderItemOptions['options'][0]['option_value']))
{
    $selectedOrderItemOptionId = $orderItemOptions['options'][0]['option_value'];
}

But my question is how do I get the Option Type based on the ID?


texts: Lots of ENOENT (no such file or directory) errors after setup:upgrade, slowing down the server to a crawl for several hours

texts:
For a while I've had the problem that my Magento 2 installation slows down to a crawl with constant 100% processor usage after running setup:upgrade. It starts off by taking about 10 minutes to even load the first page, and then gradually speeds up. Usually it goes back to normal after a couple of hours, but right now it's still stuck at about a minute per page after several days.

After checking the strace using htop to see what's going on I noticed that there is a near endless stream of ENOENT errors, after some time the errors will be less prevalent until some hours later they stop. (see images below)

I have had this occur on other projects I have been working on as well, on a lot of different versions of Magento 2 and a lot of different combinations of modules. The only thing that seems to be a common factor is that I was using the Porto theme on all these projects, but that is one of the most popular Magento themes and I can't find anyone with similar issues.

After running setup:upgrade and accessing the website:

After about half an hour:


texts: Magento 2: How to define Order of Events?

texts:
In my events.xml I have so 4-5 Observer With Events. I would like to Define Their Call Order

<?xml version="1.0"?>
    <config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Event/etc/events.xsd">
        <event name="controller_action_predispatch_module_myModule_postform">
            <observer name="captcha_post_form" instance="Custom\Module\Observer\CheckCustomFormObserver" />
        </event>
        <event name="controller_action_predispatch_skip_shoppingcart">
            <observer name="skip_shopping_cat_page" instance="Custom\Module\Observer\SkipShoppingCartObserver" />
        </event>
        <event name="controller_action_predispatch_checkout_cart_add">
            <observer name="check_shopping_cart_page" instance="Custom\Module\Observer\CheckCartObserver" />
        </event>
        <event name="controller_action_predispatch_checkout_index_index">
            <observer name="check_shopping_cart_page" instance="Custom\Module\Observer\CheckShoppingCartProductObserver" />
        </event>
        <event name="controller_action_predispatch">
            <observer name="check_login_persistent" instance="Custom\Module\Observer\CheckLoginPersistentObserver" />
        </event>
     </config>

https://devdocs.magento.com/guides/v2.0/extension-dev-guide/events-and-observers.html

As i referred above Doc. There will be no SortOrder which i can define event wise. I know each gonna call on Different Events Still can? Any Idea? Can we define Dependancy that on basis of OutPut of 1st Event 2nd or 3rd Event will be called? From 1st Observer, if result is true then call 2nd. If false then call 3rd?

What is purpose of name, because we never use anywhere. Is it for developer purpose only?


texts:
I am in need to display custom image uploaded by user into the cart page. I have a custom image with label 'image'.

The file is uploaded in RootDirectory/media/custom_images.

Can you please help me with the method to do so?


texts: How to retrieve the top 5 product ratings for a manufacturer

texts:
I need to retrieve the top 5 ratings across all products for a specific manufacturer.  We have added a custom attribute, called mfr id, but for illustration, mfr name is sufficient.
I found \Magento\Review\Model\ReviewFactory, as a means for accessing reviews, but can I join the review collection with products, filtered by manufacturer name, and then sort desc by the numeric rating for each product?
An example or any general pointers for how to join entities using the Magento 2 object model, appreciated.


texts: Removing Items from the cart doesn't update the ajax cart

texts:
I've got a problem while deleting an item from the cart.

When I try to delete any item from the cart it is updating the normal cart page.

But the item is there in the Ajax mini-cart though the quantity of the Ajax mini-cart is decreased.

But the problem doesn't persist while I change the quantity in both the carts, and they are synced pretty well except removing item.

Please help me out. I'm using Magento version 1.9, Any help would be appreciated.

Found out : When I use location.reload(true); in my onsuccess call back the page is getting reloaded and I got the desired output. But I don't wanna reload the page (That's why we use AJAX!!!) Please help me...


texts: collectRates getting called twice with different packageWeight

texts:
I have made some modifications to a third party shipping module (Webshopapps_UsaShipping, fedex) so that I can base shipping costs on the origin of which warehouse will ship the item. This is working fine.

My issue is when I put two items in the cart and change the quantity of at least one of the items to more than one, collectRates gets called twice and the results of are added together.

For instance, if my cart contains:

SKU1 , Qnty 2, 56lbs each
SKU2 , Qnty 1, 45lbs each

CollectRates is called twice. Each time it's called, the collectRates comes up with the same exact rates, but the results of each call are added together doubling the shipping. I have dumped and compared the $request that is sent to collectRates each time. I have also compared the response returned by collectRates when there is only one of each item in the cart. The returned objects are exactly the same except for the costs (I was trying to rule out maybe not passing something back to indicate the shipment is complete).

But the request sent to CollectRates is different the first and second time it's called:
The first request has

[package_weight] => 101

The second one has

[package_weight] => 56

It split it into two shipments, one of each item, and the balance of the qnty 2 item.

I am not understanding this because the rest of the request is correct, and has both cart items listed with proper quantities and individual weights.

Any idea why the system would split the shipment before sending it to collectRates (the shipping module already splits the shipment as per configuration rules)?

I'm also wondering if it's caused by another extension or default behavior of the magento system.  I've googled and haven't found anything that indicated the stock magento install would call collectRates more than once for the same cart contents. (Yes it can be called more than once when calculating cart totals, but it's only called once for the cart contents, not split like we are seeing here.)


texts: Magento 2: Adding custom attributes to pages in the front end

texts:
I've added a custom attribute in the Magento 2 back end called preorder and preordernote, then in my custom theme I have created an override to display Preorder instead of Add to Cart in the product view, as well as the preorder note.

The override is in the following structure:
Magento_Catalog > templates > product > view > addtocart.phtml.

I will also be modifying the catalog view, and cart page to include the appropriate pre order messages when a product has the preorder attribute set to 'yes'.

While this is working, I am confused as to if I have used the correct method or not. Is there a recommended way to do this type of customization?


texts: How Are Responsive Images Handled In Magento2

texts:
What is already in place to handle the use of responsive images?

Is there any internal or external library pulled in to handle this? Whether it's srcset / picture... etc? Or would we be coding from scratch or finding our own dependency?

I can't imagine Magento are not aware of this and haven't attempted to solve it (when they have lib-clearfix, etc).


texts:
This is my first time asking a question on the forum whereas I've found many answers before I haven't been able to find an answer to the following:

I am working for an online store and have been working with configurable products, creating attributes and so on. The problem came up when I had created an attribute for a product and everything was fine until I deleted the attribute before disassociating it from the product itself. Now I have quite a few products that are crashing the store when I enable them as the old attribute code is still being associated with these products.

I was able to find on Stack that this is what is causing it and have found the errant attribute code. I tried recreating the old attribute but obviously it assigns a new code.

I used Magento store Manager CustomSQL to discover the attribute code but it wont let me change anything or delete.

My question: How can I delete the old attribute code from the database?


texts: Does anyone know the file where the RWD theme account dropdwon links


texts: Any free plugin for magento elastic search

texts: I am new to Magento and wanted to know, Is there any plugin/extension that will provide elastic search/live search feature and show result in product and category.


texts: Magento error in Checkout when using saved addresses

texts:
I'm using Magento2.2.6.

When trying to checkout as a guest and filling manually the shipping address, everything works fine.
When trying to checkout as logged user it gives and error like this:

When I try to checkout as logged user but filling in manually a new address, it also works fine.

It is only throwing the error when it takes the saved addresses from my profile.

I use a custom courier module for shipping cost estimation.

Here is a link to the file:

https://drive.google.com/open?id=1-6wyyjXN-Cp16wuVTY7TSUZ1v80b5v25

Can somebody help?

The error is from here:

  $judet_dest = iconv("UTF-8", "ISO-8859-1//TRANSLIT",
  $detalii_dest["region"]);

Where:

$objectManager = \Magento\Framework\App\ObjectManager::getInstance();
$cart = $objectManager->get('\Magento\Checkout\Model\Cart');
$shippingAddress = $cart->getQuote()->getShippingAddress();
$detalii_dest = $shippingAddress->getData();


texts: Change invoice status to paid programmatically

texts:
How can we programmatically change the status of an invoice to Paid for an order with an offline payment method (eg bank transfer or cash)?

I have tried using the following capture method but this still leaves the invoice as Pending:

$order->load($_POST['order']);
$order->getPayment()->capture();
$order->save();

So how can we update an invoice with an offline payment method to Paid?


texts: return array of json after call ajax magento 1.9.3.x

texts:
I have create a search bar for search zip code for storelocator.
So in my code, i have create a request ajax who send param of zip code :

jQuery(document).ready(function(){
    jQuery("#searchzip").click(function(e) {
            e.preventDefault();
            var getcode = parseInt(jQuery("#postcode-search__input").val());
            var url = jQuery('#form-storelocator').attr('action');
            var form= jQuery("#form-storelocator");
              try {
                    jQuery.ajax({
                        url: url,
                        dataType: 'json',
                        type: "POST",
                        data: form.serialize(),
                        success: function(data) {

                        if (data['success'] === false){

                                for( var i in data) {

                                        if(jQuery.inArray(arrayzip ==data.zip)){

                                            jQuery('.storelocator-info').hide();
                                            jQuery('.storelocator-info[data-id='+data.zip+']').fadeToggle();
                                        }
                                }

                                jQuery('.storelocator-error').hide();
                           }
                            else{

                                jQuery('.storelocator-info').hide();
                                jQuery('.storelocator-error').fadeToggle();
                            }

                    }
                    });
                }
                catch (e) {
                    console.log('error' + e);
                }

        });

});

and this is my controller :

$params = $this->getRequest()->getParams();
    $zipcode = (int) $params['zip'];
    $isajax = (int) $params['isAjax'];
    $error = false;

        if($isajax == 1){

            $connection  = Mage::getSingleton('core/resource')->getConnection('core_read');
            $queryStore = "SELECT `store_postcode`  FROM `test_store`
                                                    WHERE  `store_postcode` LIKE :store_postcode
                                                     ";

            $binds = array('store_postcode'=> $zipcode.'%');
            $result = $connection->query($queryStore, $binds);

            $data = $result->fetchAll();

            foreach ($data as $key => $value) {

                    if(!empty($value)){
                        $error  = true;
                    }

                    if ($error === false){
                        $response   =   array();
                    }

                    if ($error  === true)
                    {

                        $response['success']    =   false;
                        $response['zip'] = $value['store_postcode'];
                    }
                    else{
                        $response['success']    =   true;
                    }

            }

            // var_dump( $data);

             $this->getResponse()->clearHeaders()->setHeader('Content-type','application/json',true);
             $this->getResponse()->setBody(Mage::helper('core')->jsonEncode($response));

        }
}

my response return only one result when i debug ajax with console.log(data), in my loop in javascript, i have the same result for one. Or my data in php return an array of two zipcode look that :

in yellow this my console.log in my loop in javascript, you can see i have just one result but normally i have two result.

I don't understand where is my bug ? can you help me or explain where is my mistache ?

Thank you all for help


texts: Magento 2.2.4: SEO issue - Homepage Search Results in "No information is available for this page."

texts:
I have recently replatformed from a custom PHP build to Magento 2.2.4, during the go-live process we changed from www to non-www versions of the site.  I've updated Search Console to make the preference to the non-www version of the site.

Now I'm getting the following notice:

Magento is using a stock version of the robots.txt file as seen here current robots.txt

Everything within Google says the root domain is able to be indexed:

The default domain is also not www it's the non-www version.

I also verified that the site has Index,Follow enabled.

Does anyone have any thoughts as to why this maybe occurring?


texts: How to assign some points to certain products?

texts:
A client of mine would like to assign a certain number of points to some products. The purpose is to have a situation linke this:

product A - price 10$ + n points (e.g. 10pt) //
product B - price 4$ + n points (e.g. 4pt) //
product C - price 14$ + n points (e.g. 6pt)

When checking out the customer, in addition to the total price, should also have the total number of points gained buying those 3 products.
E.G. 28$, 20pts.

Is it possible? Is there any way or any extension for this aim?

Thanks in advance.


texts: Plugin or Observer for changes on product save?

texts:
I'm trying to add a product automatically to a category when custom attribute "new" is set and remove it when it is unset. I tried to do this via plugin aroundSave

but I'm only getting same values for "new" before and after the proceed() call:

class UpdateAttributes
{
    protected $logger;
    public function __construct(LoggerInterface $logger)
    {
        $this->logger = $logger;
    }
    protected $_productCollectionFactory;

/**
 * @param \Magento\Catalog\Model\Product $subject
 * @param callable $proceed
 * @return |null
 */
public function aroundSave(\Magento\Catalog\Model\Product $subject, callable $proceed)
{

    $beforeValue = $subject->getData('new');

    $this->logger->debug('BEFOOOOOOOOOOOORE :' );
    $this->logger->debug($beforeValue);
    $result = null;

    if($beforeValue){
        $result = $proceed();
    }

    $this->logger->debug('AAAAAAAAAAAAAAAFTER :' );
    $afterValue = $subject->getData('new');
    $this->logger->debug($afterValue);

    if ($result) {

        $this->_processData($beforeValue, $afterValue, $subject);
    }

    return $result;

}

protected function _processData($before, $after, $product){
    if($before != $after){
        $this->logger->debug('-----------NOT THE SAME -----------' );
        if($after == 1){
            $this->logger->debug('-----------ADD -----------' );
            $this->_addOrRemoveFromCategory($product, ['41']);
        }
        else{
            $this->logger->debug('-----------REMOVE -----------' );
            $this->_addOrRemoveFromCategory($product, ['41'], false);
        }
    }

}
protected function _addOrRemoveFromCategory($product, $categorieIds, $add = true){
    $toAddCategoryId = $categorieIds;

    $currentCatIds = $product->getCategoryIds();
    if($add){
        $newCategoryIds = array_unique(
            array_merge(
                $currentCatIds,
                $toAddCategoryId
            )
        );
    }
    else{
        $newCategoryIds = $currentCatIds;
        foreach ($categorieIds as $id){
            $index = array_search($id, $currentCatIds);
            unset($newCategoryIds[$index]);
        }
    }

    $product->setCategoryIds($newCategoryIds);
}

}

Should I use another method or use an observer?

I'm pretty new to Magento and can't find proper literature.


texts: Magento bestseller block method - where addCategoryFilter not working

texts:
we are creating a bestseller block and use the code below. We are facing two problems.

One of which is that when I add a category filter then the method $collection->addCategoryFilter($category) just doesn't work and ends up with a blank page. It seems addCategoryFilter is not working. All other variables are present and not empty (tested).

question: Why is $collection->addCategoryFilter($category) not working in the code below?

help appreciated (Magento 1.9.2.4)

public function getCollection()
{
    $storeId = Mage::app()->getStore()->getId();
    $collection = Mage::getResourceModel('reports/product_collection')
        ->addOrderedQty()
        ->setStoreId($storeId)
        ->addStoreFilter($storeId)
        ->setOrder('ordered_qty', 'desc');

    if (Mage::helper('catalog/product_flat')->isEnabled()) {
        $collection->getSelect()
            ->joinInner(array('e2' => 'catalog_product_flat_' . $storeId), 'e2.entity_id = e.entity_id');
    } else {
        $collection->addAttributeToSelect('*')
            ->addAttributeToSelect(array('name', 'price', 'small_image'));
    }

    $_category = (int)$this->getCategory() ?: null;
    if ($_category) {
        $_category = 76;
        $category = Mage::getModel('catalog/category')->load($_category);
        $collection->addCategoryFilter($category); // gives no result, blank page
    }

    Mage::getSingleton('catalog/product_status')->addVisibleFilterToCollection($collection);
    Mage::getSingleton('catalog/product_visibility')->addVisibleInCatalogFilterToCollection($collection);
    Mage::getSingleton('cataloginventory/stock')->addInStockFilterToCollection($collection);

    $_limit = (int)$this->getLimit() ?: 3;
    $collection->setPage(1, $_limit);
    return $collection;
}

This is the SQL output. It gives some hints, one of which is

It seems to be returning only simple products (and our store contains configurable products (clothing in sizes): maybe this is a reason?

SELECT SUM(order_items.qty_ordered) AS `ordered_qty`, `order_items`.`name` AS `order_items_name`, `order_items`.`product_id` AS `entity_id`, `e`.`entity_type_id`, `e`.`attribute_set_id`, `e`.`type_id`, `e`.`sku`, `e`.`has_options`, `e`.`required_options`, `e`.`created_at`, `e`.`updated_at`, `e2`.*, `cat_index`.`position` AS `cat_index_position`, `at_inventory_in_stock`.`is_in_stock` AS `inventory_in_stock` FROM `sales_flat_order_item` AS `order_items` INNER JOIN `sales_flat_order` AS `order` ON `order`.entity_id = order_items.order_id AND `order`.state <> 'canceled' LEFT JOIN `catalog_product_entity` AS `e` ON (e.type_id NOT IN ('grouped', 'configurable', 'bundle')) AND e.entity_id = order_items.product_id AND e.entity_type_id = 4 INNER JOIN `catalog_product_flat_8` AS `e2` ON e2.entity_id = e.entity_id INNER JOIN `catalog_category_product_index` AS `cat_index` ON cat_index.product_id=e.entity_id AND cat_index.store_id='8' AND cat_index.visibility IN(2, 4) AND cat_index.category_id = '54' INNER JOIN `cataloginventory_stock_item` AS `at_inventory_in_stock` ON (at_inventory_in_stock.`product_id`=e.entity_id) AND ((at_inventory_in_stock.use_config_manage_stock = 0 AND at_inventory_in_stock.manage_stock=1 AND at_inventory_in_stock.is_in_stock=1) OR (at_inventory_in_stock.use_config_manage_stock = 0 AND at_inventory_in_stock.manage_stock=0) OR (at_inventory_in_stock.use_config_manage_stock = 1 AND at_inventory_in_stock.is_in_stock=1)) WHERE (e.type_id = 'simple') GROUP BY `order_items`.`product_id` HAVING (SUM(order_items.qty_ordered) > 0) ORDER BY `ordered_qty` desc


texts: How do you make a product older and remove it from latest products?

texts:
How do you make a product older.

I have a list of products that show up in the latest products after a product import after migrating to magento 2.

I would like to make some products show in the latest products slider.


texts: Magento 1.9.1.1 conflict with PHP 5.4.28 php-fpm gzip compression

texts:
After upgrading to PHP 5.4.28, Magento Connect Downloader is broken. The iframe downloader won't work. Screenshot below. Disabling php-fpm gzip compression allows Magento Connect Downloader to work normally.

Isn't the php-fpm gzip compression extension needed by Magento? How can this be fixed correctly?

UPDATE: Tried on PHP 5.5 with fresh Magento install. The issue persists.


texts: Magento 2: How to load admin login on home page?

texts:
I want to display admin login on home page. How can I do this?

Any help will be appreciated.


texts: How to create different top menu for different websites?

texts: In single magento installation we can create several websites. Is it possible to have different top menus for each of these websites?


texts: Magento 2 - There are no commands defined in the "setup" namespace on windows

texts:
I have a problem when I run this command:
php bin/magento setup:upgrade

Display error:

[InvalidArgumentException] There are no commands defined in the
"setup" namespace.

I found some answers but not in my case(I run in Windows 7 and Xampp).
There are no commands defined in the “setup” namespace : Magento 2
On frontend display:

Last time, I fixed is the system my pool code have errors with my module. And now I remove all my modules but error until display.
Anyone used to fix this problem, Can you tell me how to fix this problem?
When I run the command to install again composer, it returns error below:


texts:
I have website in magento. i have upgraded version 1.9.1.1. to 1.9.3.1 successfully. but everday 1AM i got email with error message like.

Product alerts cron warnings: SQLSTATE[42S22]: Column not found: 1054 Unknown column 'catalog_product_entity_group_price.is_percent' in 'field list', query was: SELECT catalog_product_entity_group_price.value_id AS price_id, catalog_product_entity_group_price.website_id, catalog_product_entity_group_price.all_groups, catalog_product_entity_group_price.customer_group_id AS cust_group, catalog_product_entity_group_price.value AS price, catalog_product_entity_group_price.is_percent FROM catalog_product_entity_group_price WHERE (entity_id='3754') AND (website_id IN(0, '5'))

the table having "is_percent" field i dont know why it happen.

Please help me anyone

Thanks
Mohan NK


texts:
Could anyone say why the below line is creating issue in My Magento 1 Web Store ?

<script type="text/javascript" src="https://cdn.jsdelivr.net/jquery/3.1.1/jquery.min.js"></script>

I am getting following errors

Uncaught TypeError: element.attachEvent is not a function(…)
Uncaught TypeError: jQuery(...).superfish is not a function(…)
Uncaught TypeError: element.dispatchEvent is not a function(…)
Failed to load resource: net::ERR_CONNECTION_RESET
Uncaught TypeError: jQuery(...).prepare_slider is not a function(…)


texts:
I have a block setup which will display the products for a category, such as this:

{{block  type="catalog/product_list" category_id="4" template="catalog/product/working-simple-list.phtml"}}

(I'm calling a custom list.phtml in the block so I can control the formatting etc). This block is then called from the category page.

The question is: how can I avoid having to manually enter the category_id? Currently, if I want to call this list.phtml on 5 categories, I need to create 5 unique block calls, setting the ID by hand for each category I want to show it on.

Much cleaner, simpler, would be have it automagically pull the ID, based on which page its called from. Then I would only need one block 'show custom list', and could call it from anywhere.

Any ideas?! Thanks.


texts: Magento2 How to get the default attribute set id for Customer?

texts: How to retrieve default attribute set ID for the customer? And also is it possible in the practical scenario to have multiple attribute sets for EAV entity type Customer? I know in the case of entity type product, you can create multiple attribute sets but is it also normal in the case of the customer as well?


texts: how to switch currency depending on the language code in $ _SERVER

texts:
I use a separate translation service, it makes a copy of my frontend and redirects to another domain. I am using language switcher from this service. since they are not related to magento stores I cannot add my own currency for each store
but, to switch the currency, the service focuses on the language code in my variable $ _SERVER
["HTTP_SERVISE_LANGUAGE"]=>  string(2) "fr"
help implement an observer that will change currency depending on the code that comes into the variable $_SERVERS


texts:
When i try to send an email throughgh Email your friend https://prnt.sc/olekdn i am getting this error
https://prnt.sc/olek0m
SMTP configurations are https://prnt.sc/olel1c.

Please help what can be the issue


texts: Magento 2 : How to Create Recent Orders Block on CMS Page or Static Block

texts:
I want to call block on the home page of the store. how can I add recent order block on store home page from admin? Thanks

I have tried this <p>{{block class="Magento\Sales\Block\Order\Recent" template="Magento_Sales::order/recent.phtml"}}</p>
Thanks


texts:
I have an observer, using this event: catalog_product_save_after , where I would like to assign some website ids to my product. This is my code:
public function execute(Observer $observer)
{
    $product = $observer->getProduct();
    $product->setWebsideIds([1,6,7]);
    try{
        $product->getResource()->saveAttribute($product, 'website_ids');
    }catch (Exception $error){
        var_dump($error->getMessage()); exit();
    }
}

The thing is that I am receiving the following error:
Error: Call to a member function getBackend() on bool in /var/www/html/myproject/vendor/magento/module-eav/Model/Entity/AbstractEntity.php:1666.
Also, the observer is triggered , when i want to create a new product via the magento API: rest/V1/products. Any idea, what should i do here ? Thank you


texts: Magento 2: How to set radio input value using ui form

texts:
I need to create gender radio input using magento ui component form

<field name="gender">
            <argument name="data" xsi:type="array">
                <item name="config" xsi:type="array">
                    <item name="description" xsi:type="string" translate="true">Gender</item>
                    <item name="dataType" xsi:type="string">boolean</item>
                    <item name="formElement" xsi:type="string">radio</item>
                    <item name="valueMap" xsi:type="array">
                        <item name="true" xsi:type="boolean">male</item>
                        <item name="false" xsi:type="boolean">femal</item>
                    </item>
                </item>
            </argument>
    </field>


texts: Send email of different template in Magento

texts:
I am getting mail content as object instead of HTML content...
Here is my Magento Code

//mail
$this->_initLayoutMessages('customer/session');
$this->_initLayoutMessages('catalog/session');

//get customer details
$customer = Mage::getSingleton('customer/session')->getCustomer();
$customer->getId();
$customer->getEmail();

//get general store details
$from_name = Mage::getStoreConfig('trans_email/ident_general/name');
$from_email = Mage::getStoreConfig('trans_email/ident_general/email');
$templateId = 7;        // My Email Template ID
$emailTemplate = Mage::getModel('core/email_template')->load($templateId);

$mail = Mage::getModel('core/email');
$mail->setToName($from_name);
$mail->setToEmail($from_email);
$mail->setBody($emailTemplate);
$mail->setSubject('Sample Mail Subject');
$mail->setFromEmail($customer->getEmail());
$mail->setFromName("Msg to Show on Subject");
$mail->setType('Html');

try {
    $mail->send();
    Mage::getSingleton('core/session')->addSuccess('Your request has been sent');
}
catch (Exception $e) {
    Mage::getSingleton('core/session')->addError('Unable to send.');
}

I want the HTML contents of the template as the output.

Please Help ! Thank you.


texts: Magento 2.2 custom product attribute not visible on catalog / category page

texts:
So I've created 6 custom attributes in my modules using installData.php
let's take two of them:

  $eavSetup->addAttribute(
            \Magento\Catalog\Model\Product::ENTITY,
            'badge1text',
            [
                'type' => 'text',
                'backend' => '',
                'frontend' => '',
                'label' => 'Badge 1 Text',
                'input' => 'text',
                'class' => '',
                'source' => '',
                'global' => '',
                'visible' => true,
                'required' => false,
                'user_defined' => false,
                'default' => '',
                'searchable' => false,
                'filterable' => false,
                'comparable' => false,
                'visible_on_front' => false,
                'used_in_product_listing' => true,
                'unique' => false,
                'apply_to' => ''
            ]
        );

        /**
         * Insert/Create a seletbox attribute with custom options
         */
        $eavSetup->addAttribute(
            \Magento\Catalog\Model\Product::ENTITY,
            'badge1image',
            [
                'type' => 'int', // data type to be saved in database table
                'backend' => '',
                'frontend' => '',
                'label' => 'Badge 1 Background',
                'input' => 'select', // form element type displayed in the form
                'class' => '',
                'source' => 'UNBXD\ProductAttributes\Model\Config\Source\MyCustomOptions',
                'global' =>\Magento\Catalog\Model\ResourceModel\Eav\Attribute::SCOPE_STORE, ,
                'visible' => true,
                'required' => false,
                'user_defined' => false,
                'default' => '',
                'searchable' => false,
                'filterable' => false,
                'comparable' => false,
                'visible_on_front' => true,
                'used_in_product_listing' => true,
                'unique' => false,
                'apply_to' => ''
            ]
        );

and here's my custom select source:

class MyCustomOptions extends \Magento\Eav\Model\Entity\Attribute\Source\AbstractSource
{
    /**
     * Get all options
     *
     * @return array
     */
    public function getAllOptions()
    {
        if ($this->_options === null) {
            $this->_options = [
                ['value' => '',  'label' => __('Please Select Background Color')],
                ['value' => '1', 'label' => __('Purple')],
                ['value' => '2', 'label' => __('Blue')],
                ['value' => '3', 'label' => __('Pink')],
                ['value' => '4', 'label' => __('Green')]
            ];
        }
        return $this->_options;
    }

    /**
     * Get text of the option value
     *
     * @param string|integer $value
     * @return string|bool
     */
    public function getOptionValue($value)
    {
        foreach ($this->getAllOptions() as $option) {
            if ($option['value'] == $value) {
                return $option['label'];
            }
        }
        return false;
    }
}

The problem is that 'Badge 1 Background' value isn't visible on catalog / category page. Only 1st value placeholder is accessible 'Please Select Background ' ...not real value. On product page all is fine.
I've try to used those code to display value on catalog:

$attribute = $_product->getResource()->getAttribute('badge1image');
$attr_value = $attribute ->getFrontend()->getValue($_product);
echo $attr_value;

What I've missed on InstallData file? Looks like text field is visible but not select with dropdown options...


texts: How to add product video to custom carousel / gallery on product page

texts:
The below code is how my product page gallery/carousel is pulling in images, how can I include product videos in this?

    <?php foreach($images as $image): ?>

            <img src="<?php echo $image->getData('medium_image_url') ?>" class="main-image">

    <?php endforeach; ?>


texts: Magento 1.9 How to add buy now button in product page?

texts:
I am using magento 1.9, I want to add BUY NOW button on product details page, Buy now button redirect to checkout page. I tried many solution already solved in this forum, But all the solutions are BUY NOW button redirect to cart page only. Here I was list outed already tried solutions are,

Solution1
Solution2
Solution3
Solution4
Solution5


texts:
I have created a custom module probably 20 times and it is showing the same 404 error.

I have searched for an issue and eventually found nothing.
isn't it because I am using ubuntu.

Please correct me if I am wrong.

This is my app/etc/Kuldeep_HelloWorld.xml file:

<?xml version="1.0"?>
<config>
    <modules>
        <Kuldeep_HelloWorld>
            <active>true</active>
            <codePool>local</codePool>
        </Kuldeep_HelloWorld>
    </modules>
</config>

This is app/code/local/Kuldeep/HelloWorld/etc/config.xml

<?xml version="1.0"?>
<config>
  <modules>
    <Kuldeep_HelloWorld>
      <version>0.1.0</version>
    </Kuldeep_HelloWorld>
  </modules>
  <frontend>
    <routers>
      <helloworld>
        <use>standard</use>
        <args>
          <module/>Kuldeep_HelloWorld</module>
          <frontName>hey</frontName>
        </args>
      </helloworld>
    </routers>
  </frontend>
<admin>
  <routers>
    <helloworld>
     <use>admin</use>
     <args>
      <module>Kuldeep_HelloWorld</module>
      <frontName>admin_helloworld</frontName>
     </args>
    </helloworld>
  </routers>
</admin>
<global>
  <helpers>
    <helloworld>
      <class>Kuldeep_HelloWorld_Helper</class>
    </helloworld>
  </helpers>
</global>
<adminhtml>
 <menu>
   <helloworld module="helloworld">
     <title>HelloWorld</title>
     <sort_order>100</sort_order>
    <children>
      <helloworld module="helloworld">
        <title>Hello World</title>
        <sort_order>0</sort_order>
        <action>admin_helloworld/adminhtml_index</action>
      </helloworld>
    </children>
   </helloworld>
 </menu>
</adminhtml>
</config>

This is controller file:
app/code/local/Kuldeep/HelloWorld/controllers/IndexController.php

<?php
class Kuldeep_HelloWorld_IndexController extends Mage_Core_Controller_Front_Action{

   /**
   * Index action
   *
   * @access public

   * @return void
   */
   public function indexAction() {

      echo "it works!";

   }

   public function doneintagainAction() {

      echo "done it again....!!!!";
      }
}
?>


texts: I cannot add new products in Magento because de main options are not showing after clicking on "Add new product", I attach an screenshot. As you can see see in the left menu there are missing several options. What happens? Thanks. (magento 1.7.0.2)


texts: Customize mini-cart - delete image and edit button

texts:
How to remove the picture and edit button from the mini-cart without using CSS

Expected Result


texts: Magento 1: Editing Category Name from admin

texts:
I am editing a category name from Magento 1 admin. The changes and shows in the breadcrumbs but it does not show up in the navigation menu bar. Does it mean that they are manually/statically written in some menu file or is it some other issue?

The other day when we as well tried to deactivate a category, it does not go away from the nav menu but on click, the page says 404 error.


texts: In store pick up is only option for orders under $50

texts:
For some reason when customers spend $50 or less, the only option displayed is in-store pick up. There are no shipping options displayed.
I can't find anything in the shipping options that would be controlling this.
Any ideas?


texts: Changing 0.00 price to retail price from attribute see details

texts:
We have about 250 items in Magento 1.9 community that got migrated over with 0.00 showing as price.  This was because old site had it set that way.  However the retail price is there and it is set as one of the attributes prices.  Is there anyway to fix this without doing each one manually?

Thanks


texts: Difference between catalog_product_prepare_save and catalog_product_save_before

texts:
What is the difference between catalog_product_prepare_save and catalog_product_save_before?

I have an observer that updates some attributes when a product is saved. It works great when I save a product from admin, however it doesn't work when saving from a script I wrote.

Through my research in writing the observer, I was using catalog_product_save_before. Someone on here told me I should be using catalog_product_prepare_save. Although it didn't solve the problem at the time, I kept with it as eventually I got everything working.

My new research is telling me when I call $product->save(), it doesn't trigger catalog_product_prepare_save, but it does trigger catalog_product_save_before, so I'm considering switching my observer to catalog_product_save_before but can't find much documentation between the two. Wondering if I'm going to experience any adverse behavior by switching since I'm not sure why several people told me to use catalog_product_prepare_save in the first place.


texts: Get access to images with 2 different URLs

texts:
I want ANY image in any folder in my magento website could be able to get accessed both with its actual file name OR a .MAIN extension at the end of the file.

As an example, In case I have an image like:

http://www.whatever.com/media/catalog/product/cache/1/small_image/218x330/9df78eab33525d08d6e5fb8d27136e95/i/p/whatever-name.jpg

I want it to get access with both follwoing URLs:

http://www.whatever.com/media/catalog/product/cache/1/small_image/218x330/9df78eab33525d08d6e5fb8d27136e95/i/p/whatever-name.jpg
http://www.whatever.com/media/catalog/product/cache/1/small_image/218x330/9df78eab33525d08d6e5fb8d27136e95/i/p/whatever-name.jpg.MAIN

I tried to adding some URL rewrite rules under /media/.htaccess but no luck at all:

RewriteRule ^(.*)(\.MAIN)$ $1

So my .htaccess file is look like this:

Options All -Indexes
<IfModule mod_php5.c>
php_flag engine 0
</IfModule>

AddHandler cgi-script .php .pl .py .jsp .asp .htm .shtml .sh .cgi
Options -ExecCGI

<IfModule mod_rewrite.c>

############################################
## enable rewrites

    Options +FollowSymLinks
    RewriteEngine on

############################################
## never rewrite for existing files
    RewriteCond %{REQUEST_FILENAME} !-f

############################################
## rewrite everything else to index.php
    RewriteRule ^(.*)(\.MAIN)$ $1
    RewriteRule .* ../get.php [L]
</IfModule>

Actually NO rule working in this media .htaccess file. I tried many different other dummy rules for other purposes non of them even working.

How can I accomplish this ?


texts: how to get link My Cart and Check out in top.links in magento2?

texts:
i want get link My cart and check out to top.links. any help?

and i tried get  language in top.links  <block class="Magento\Store\Block\Switcher" name="store_language" as="store_language" template="switch/languages.phtml"/> in header.panel. But not success. how do get it?

Many thank.


texts:
Is there anyway I can force a reconnect to Mysql with Magento? or Replace the connection entirely?

I have an importer which is slow, and is very custom using Magento models. Before you say it... No I don't want t use any off the shelf products. This is super specific. A way of speeding this up would be to pcntl fork during a part of the application to improve import speed. The issue with pcntl_fork is that the db connection will go bad as soon as you fork. So I need to totally reconnect the Mage core connection so that my forked process is new connection. So any mage core model save will automatically be using the new connection rather that the parent pcntl processes connection.

Ideas?

Cheers


texts: Why do i have to always run the commands to clean cache in Magento 2.1.8?

texts:
Whenever I make any change to CSS of my Magento store, it doesn't seem to be updated.

I also tried to clean the cache from the Magento admin dashboard but it didn't work.

Now I always have to run the following commands via putty.

sudo php bin/magento setup:upgrade
sudo php -dmemory_limit=4G bin/magento setup:static-content:deploy
sudo php bin/magento cache:clean
sudo php bin/magento cache:flush
sudo chmod -R 777 var

Server - EC2 (Amazon AWS)

Please help!


texts:
I am new to magento, I am building a store in this I have deployed the site in the domain.com/shop subfolder, now the problem is that the images are not loading in my site, I think it is due to .htaccess file, but I don't have proper understanding in that.

1) Site without .htaccess in pub directory

2) Site with .htaccess inside pub directory

I tried deleting cache, building index, setup:upgrade etc...
Please guide me on this

Adding admin login snapshot :


texts: Magento 2 How to configure Gmail SMTP for email sending?

texts: In Magento 2, the username and password are no longer set in template.php under Email module. How can I use Gmail SMTP for email sending in Magento 2? How to configure it? Thanks


texts:
We have a lot of grope products in our store.
We want to see if there is possible to remove the "in stock" when one of the products is sold out.
We have turned off so they are not able to buy the products as long some of the group product is not "in stock" however, when they are browsing it says "in stock". Is it possible to remove "in stock" if 1 or more items are sold out?


texts: How to disable quantity edit in frontend for grouped products

texts:
Some Brief

I want to sell products like tea, coffee, juice etc they are in small packets each packet cost is around $3.73. For this i will make it simple product in magento. So when customer will purchase it. Its quantity will be deducted.

BUT

I also have 3 subscription plans, before becoming our customer he/she will compulsory have to buy subscription plan first, and it is one time only, then later customer can purchase individual products according to his needs in terms of quantity. But on first transaction they have to buy subscription plan only. Now, in that subscription plans i am selling the same simple products in multiple quantity that means in first plan coffee 20 packates and in second plan coffee 30 packages and so on.

Now, lets come to problem according to magento's flow.

If i enter all the product as simple products in magento admin, this will be okay for individual packets selling, but how will i manage them in subscription plans because when someone will purchase subscription plans we have to deduct 20 quantity from the same simple product

What i did

I have tried adding it as grouped product and i think it will serve my purpose, but in groped products also in Associated Products section there is column of putting quantity that is perfect for me. But that quantity is editable in frontend. Is there any possibility to disable it so that customer will buy the quantity what i want him to buy he should not be able to edit that quantity.

Any help would be greatly appreciated.


texts: If email exists force customer to login before ordering

texts: My current configuration is allowing customers to place orders without having to log-in on checkout,  even though they currently have accounts in the system, with the same e-mail we have stored for them,.  These orders they place without being logged in are therefore not viewable in their order history when they do log-in. Is there any way to require that they log-in if their e-mail address exists in the system, before ordering? I've been looking for a setting in the admin but to no avail.  I am using oneStepCheckOutAn. An admin setting would be preferred over having to insert validation code into the system, but anything helps! Thanks!


texts: Remove Help Icon in Magento Backend Page

texts:
I want to hide or remove help icon in magento backend page,
here I show screenshot for my problem.


texts: magento stuck in billing information of checkout

texts:
I fill billing information form and click on continue but dosn't work.
In firebug Response:
"OK
Fatal error:  Undefined class constant 'CHARS_PASSWORD_LOWERS' in .../app/code/core/Mage/Customer/Model/Customer.php on line 381"


texts: Purpose of Template_Smarty and Template_Zend blocks

texts:
In the folder app/code/core/Mage/Core/Block/Template there are 3 blocks declared.

Mage_Core_Block_Template_Facade - I found where this is used. It is used twice for the product view page in order to set some containers.
Mage_Core_Block_Template_Smarty - I found no reference of this. Anyway, this class just extends a core template. Most likely someone wanted to use smarty with magento and abandoned the idea.
Mage_Core_Block_Template_Zend - this has some methods in there. But again I did not find a use of it.

Are the last 2 blocks useful for something? My money is on "unfinished business" but I was wrong before (with this for example).
Any opinion on this? Anyone used these blocks before?


texts: How to Get product attribute set id by attribute set name in Magento 2?

texts:
I have a product attribute set name DSLR, in frontend page i need to get product collection filtered b this product attribute set

$dslrAttributeSetId = $this->getAttributeSetIdByName('DSLR'); //how??
$collection->addAttributeToFilter('attribute_set_id', array('eq' => $dslrAttributeSetId));

how can i get this product attribute set id by product attribute set name?


texts: How to add product with category name instead of category id in Magento using Rest API

texts: I want to add product with category name instead of category id in Magento using Rest API.


texts: I can't setup VAT for german shop in magento 1.9

texts:
I setup a Tax Class * with 19%, the I add a product with the price 32.77, this price is without VAT

after this I setup the tax in System > Configuration > Sales > Tax like this:

My problem is that i have this warning and the Catalog Product Prices is still 32.77, when VAT is added the price in catalog must be 39. And the same in the checkout page the VAT is not calculated.


texts: Magento 2: Other required columns in CSV to update Name, Quantity & Price

texts:
I want to update products on my Magento 2 Website with csv bulk import. I have downloaded the export file but it has too many columns.

I will only update the Product name, Quantity & Price. Nothing else.

I want to remove the unnecessary columns as much as possible.

I want to know what are the necessary columns which should be there to upload?


texts: Error while setup upgrade magento 2.0.7?

texts:
sudo rm -rf pub/static/*

sudo php bin/magento setup:upgrade

I have set 777 permission to pub but still getting

  [Exception] :

  Missing write permissions to the following directories: '/var/www/magento2/pub/static'

Suggest some solution.


texts:
Is it possible to have multiple collections in one grid? Suppose if we have grouped data, and we need to display it in multiple dynamic child grids.

Suppose data is:

firstname lastname city
Group 1:
mark      james     new york
mark      james     new york

Group 2:
mark      james     california
mark      james     california

Group 3 :
aston    wright     france
aston    liam       france

Is it possible?


texts:
I have set the products tags off in the Admin but they are still shown in the product reviews.

I have try to add to local.xml

<catalog_product_view>
<reference name="product.info.additional">
    <action method="unsetChild"><name>product_tag_list</name></action>
</reference>

But i still have the tabs in the product reviews.
should i call something else rahter

<catalog_product_view>


texts: What is __construct and _construct in magento2?

texts: In Magento 2, most of classes have these two constructs (__construct and _construct) methods. What is the difference between them?


texts: Only header loads once an item is added to the cart

texts:
Ever since moving our Magento store to a new server we have been having strange issues with the store.

Currently the store appears to work correctly but once an item is added to the cart all the pages break. The only part that loads is the header.

View the issue here by adding any item to the cart:
http://xpresselectrical.ie

There hasn't been any changes to the code base since moving to the new server so I must assume there is something different about this servers configuration.

I have enabled ini_set('display_errors', 1); in index.php but no errors are shown.

Does anybody know what would cause this issue or how it can be resolved?

Thanks.


texts: Add UI component on form directly in Magento 2

texts:
I want to add UI component Vendor/Module/view/base/web/js/modal.js

define([
    'jquery',
    'Magento_Ui/js/modal/modal'
], function ($, Modal) {
    return Modal.extend({...});
});

directly to the customer edit form (Vendor/Module/view/adminhtml/ui_component/customer_form.xml):

<?xml version="1.0" encoding="UTF-8"?>
<form xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
      xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Ui:etc/ui_configuration.xsd">

</form>

What should I write in customer_form.xml in this case?


texts: Magento Randomly Entering Maintenance Mode

texts:
I'm on magento 1.8 and have a really strange thing happening at 5am every morning... a maintenance.flag appears in my root folder, putting the site into maintenance mode...

I have tried changing all the passwords etc but it still happens. In the access logs, all I can see is the cron.php (which runs every minute) running at a few seconds after 5am

I've also checked the error logs etc, no idea what is causing this. I've also changed FTP password and root passwords for the server.

Also what happens is I get the attached error when I try to access admin. I restart SQL and it starts working again...


texts: Coupon code only applicable for certain product?

texts:
Is it somehow possible to make a coupon code in the cart only applicable if a certain product is in the cart and only this product, no other products at all except one defined product?

Possible with standard Magento 2 features? If not, any extension out there that might help here?

Thanks!


texts: Add Company Name to Billing/Shipping Dropdown in Magento

texts:
We are working on a magento store website for a customer who only deals business to business. On the Magento onepage checkout, we want the address select dropdown box to show the company name and address, rather than just the individual's name and address. I've been trying to figure out how to do this but am completely stuck. The dropdown itself is given by the code

<?php echo $this->getAddressesHtmlSelect('billing') ?>

The block that creates this is

public function getAddressesHtmlSelect($type)
{
if ($this->isCustomerLoggedIn()) {
    $options = array();
    foreach ($this->getCustomer()->getAddresses() as $address) {
        $options[] = array(
            'value' => $address->getId(),
            'label' => $address->format('oneline')
        );
    }

    $addressId = $this->getAddress()->getCustomerAddressId();
    if (empty($addressId)) {
        if ($type=='billing') {
            $address = $this->getCustomer()->getPrimaryBillingAddress();
        } else {
            $address = $this->getCustomer()->getPrimaryShippingAddress();
        }
        if ($address) {
            $addressId = $address->getId();
        }
    }

    $select = $this->getLayout()->createBlock('core/html_select')
        ->setName($type.'_address_id')
        ->setId($type.'-address-select')
        ->setClass('address-select')
        ->setExtraParams('onchange="'.$type.'.newAddress(!this.value)"')
        ->setValue($addressId)
        ->setOptions($options);

    $select->addOption('', Mage::helper('checkout')->__('New Address'));

    return $select->getHtml();
}
return '';
}

I'm completely lost with this and any help would be gratefully received.


texts: Moving a online Magento from a server to another (including domain, emails and magento files)

texts:
I have tricky situation (for me at least) that I have not been in before.

We are going to take over a customers hosting of Magento, the domain and the emails (only one email).

This is something we do usually with websites, but I have never done it for a Magento. Moving one that is not online, no problem. But the issue I'm thinking about is actually moving on that is online, meaning that if I for example take a copy of the webshop at 08.00 and get it up on another server at 09.00 there will be one hour gap, between the versions.

The only solution I see here is to take the webshop offline while we're moving it. Meaning that it would be offline for 2-4 hours or more.

Is there a smoother way to do this?

I was thinking about another option as well. Taking it offline while coping the ftp and mysql to another server, and then make the current registrar point to the new server.

Any suggestion how other people doing while a webshop is online to keep up everything fresh?


texts: Someone is accessing my downloader..What's in /downloader/index.php ? How can I disable it since I never plan to use Magento Connect?

texts:
I have a few Magento 1.9 sites running on the same VPS server. I noticed today that the load on the server was unusually high. When I went to investigate, I found out someone was accessing my public_html/downloader/index.php of one of the Magento sites and that was taking up about 35% of my CPU. This is definitely NOT intentional as I am the only one with access to all those Magento sites.

Here are the questions:

What does downloader/index.php suppose to do? Is that a functionality of Magento Connect?
Is there a breach of security I need to worry about? (when I suspended that entire account on the server, the same exact thing started happening with another Magento account; when I suspended that one - the load went down to normal)
Since I never ever plan to use Magento Connect (things have gone down a really bad path every time I tried to use it in the past) - can I disable it and HOW?


texts: Inserting a block in a CMS page between content heading and content

texts:
I am trying to add a custom block on all CMS pages after the page's Content Heading but before the page's Content.

For reference, this is what is in my theme's layout/cms.xml, I haven't touched it:

<cms_page translate="label">
    CMS Pages (All)
    <reference name="content">
        <block type="core/template" name="page_content_heading" template="cms/content_heading.phtml"/>
        <block type="page/html_wrapper" name="cms.wrapper" translate="label">
            CMS Content Wrapper
            <action method="setElementClass"><value>std</value></action>
            <block type="cms/page" name="cms_page"/>
        </block>
    </reference>
</cms_page>

The content of cms/content_heading.phtml is just this (the heading, as expected), again, haven't touched it:

<?php if($_heading = $this->getContentHeading()): ?>

<?php echo $_heading; ?>

<?php endif; ?>

In my local.xml file, I am adding this:

<default>
    <reference name="content">
        <block type="core/template" name="my.new.block" after="page_content_heading" template="callouts/my_new_block.phtml" />
    </reference>
</default>

This is putting the block below the Content Heading AND the Content of the page.

I have also tried this (adding "before" tag):

<default>
    <reference name="content">
        <block type="core/template" name="my.new.block" before="cms_wrapper" after="page_content_heading" template="callouts/my_new_block.phtml" />
    </reference>
</default>

This is the same as above.

What am I missing? Thanks very much for any help.

(FYI, I am flushing my cache regularly. I'm using Magento 1.8.1)


texts: Magento - Set Custom Attribute not working in customer_register_success Observer

texts:
I am using the extension 'Customer Attributes'. I can modify values in the Magento backend in e.g. a controller. And I can read the values programmatically via PHP, but I can not set the values in my customer_register_success Observer.

public function customerRegisterSuccess(Varien_Event_Observer $observer) {
$event = $observer->getEvent();
$customer = $event->getCustomer();
$customer = Mage::getModel('customer/customer')->load($customer->getId());
$customid = $customer->getData('customid');
$customer->setData(array("customid"=>24)) ;

This last row is not working. And I can not save().

On my stage environment after printing out the value before and after (echo $customer->getData("customid")) it showed the change. But I could not save().

On my live environment it crashed while registration process, saying ,, Integrity constraint violation: 1452 Cannot add or update a child row: a foreign key constraint fails "


texts: I WANT TO CREATE TWO URL'S FOR SAME PRODUCT FOR MAGENTO 2

texts:
I want to create two URLs for the same product, one URL that is with products SKU i.e. https://domainname/skuNo. And another URL is for SEO purpose i.e. https://domain name/product name.html
Where both URLs we can go to the same page.
We are using MAGENTO 2.3
Thanks


texts:
I've displayed item's price (both old price and new price) using this code,

<?php echo $_item->getProduct()->getPrice(); ?>

But when I see the page, it displays price with 4 decimal numbers,
like 150.0000

I need to change number of decimals after the . to be two. like 15.00

How can I do this?
I'm okay with however getting formatted number, when $_item->getProduct()->getPrice(); gives 15.0000 I need to change it into 15.00 however way possible.

Can anybody help me?

- NOTE -

I've found php way to format the numbers.

<?php $oldprice = $_item->getProduct()->getPrice();
             echo number_format($oldprice, 2, ".", ",");
             ?>

But the problem is, I've to put this everywhere I need to change the format


texts:
I see many posts regarding the order grid color change, but I want to know how to change the product grid color change.

If anybody else did this, please let us know.


texts:
I am wondering if this is possible.

I would like to create same functionality as this image in my custom module.

I could use a widget- product chooser, however that is letting me choose only one product. I need to select more than one product.

I will have just a button where I can click and then it will render the product chooser grid and then when selected multiple items, it sends id or sku in the input field.

Then later on I will save this info in to database.

Please suggest.


texts:
I had attempted to import categories into my magento using SQL, but looks like it hasn't worked. In manage categories section it looks like this:

The numbers suggest correct product linking but other than that broken, clicking the expand button also does nothing.

**UPDATE:   **

I have got the categories, and sub-categories to display. But the products although correctly showing in the count next to the categories, they are not appearing when I click on the actual category and got to the category products tab:


texts: Invalid Block Type "Products are not showing up on home"

texts:
I am having an invalid block type at the products.info.upsell, and this its not showing the products on hame page.

Undefined variable: block  in /var/www/html/XXXXXX/web/includes/src/__default.php on line 27684

That line is

if ($block) {
        $block->setBlockParams($blockParameters);
        foreach ($blockParameters as $k => $v) {
            if (in_array($k, $skipParams)) {
                continue;
            }
            $block->setDataUsingMethod($k, $v);
        }
    }

How should I repare this error?

The code that I use to appear the products on the home is this one, as said by the theme owner

{{block type="catalog/product_list" category_id='4' block_name='Óculos Masculinos' template="carousel/products_horizontal.phtml"}}

My site is http://grupomari2.dominiotemporario.com/

and should look like this :

http://demo.ethemeuk.com/megatron/magento/demo/index.php?___store=default


texts:
I found out that clicking on "in cart" button on a product page is not working anymore. (www.deli-discountnl) while on the overview page when you click on the basket it still works. And I am having a system.log of 500 mb!?

This is the first line:

  2016-10-10T10:16:37+02:00 ERR (3): Warning: simplexml_load_string():
  Entity: line 96: parser error : StartTag: invalid element name  in
  lib/Varien/Simplexml/Config.php
  on line 383 2016-10-10T10:16:37+02:00 ERR (3): Warning:
  simplexml_load_string():
  ><sortorder/><location_picker>0</location_picker></dhlforyou_1456932693927_927><
  in
  lib/Varien/Simplexml/Config.php
  on line 383 2016-10-10T10:16:37+02:00 ERR (3): Warning:
  simplexml_load_string():
  ^  in
  lib/Varien/Simplexml/Config.php
  on line 383

This is line 383 of the config.php:

$xml = simplexml_load_string($xmlString, $this->_elementClass);

What is going wrong here? Even more important, how can I fix it?

It is a multistore and with the other site (different template) www.vizenco.nl and www.bakmina.nl there is no problem.


texts: Magento 2: How to override Item Info of MiniCart

texts:
I would like to override Item Info of Mini Cart here as well as on Checkout Sidebar

I need to apply changes on price. Which files need to override & function?


texts: Fill custom attribute product during checkout

texts:
Imagine this situation: in some situation the user, (in the cart view) are able to buy  a special discount card, this card need the username, lastname and birthday.

In my configuration I have a product "discount card" with a special attribute set for handling the input data (name lastname birthday).

Now I need to understand how to proceed with situation or if another better situation exist. One alternative is to create each time a virtual product with this data filled but sound awful.

Please if someone can give an hint I would be very grateful


texts: Magento 2 Custom Widget set template data not showing at frontend

texts:
I am working to create custom widget in custom extension. I followed this to create widget in my custom extension.
All working fine but data not showing in the template
 $this->setTemplate('widget/viewed_list.phtml');

Below my code:

  Technologymindz/Instagramfeed/Block/Widget/Instawidget.php

<?php
namespace Technologymindz\Instagramfeed\Block\Widget;

class Instawidget extends \Magento\Framework\View\Element\Template implements \Magento\Widget\Block\BlockInterface
{

    public function _toHtml()
    {
        $this->setTemplate('widget/viewed_list.phtml');

    }

}

  Technologymindz/Instagramfeed/etc/widget.xml

<?xml version="1.0" encoding="UTF-8"?>

<widgets xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../Magento/Widget/etc/widget.xsd">
    <widget id="tm_customwidget" class="Technologymindz\Instagramfeed\Block\Widget\Instawidget">
        Instagram Feeds
        <description>Show Your Instagram Feeds Anywhere</description>
        <parameters>
                        <parameter name="tmfeedtoshow" xsi:type="select" required="true" visible="true">
                            Show Latest Feeds
                            <options>
                                <option name="default" value="12" selected="true">
                                    12
                                </option>
                                <option name="list" value="24">
                                    24
                                </option>
                            </options>
                        </parameter>
            <parameter name="tmview_type" xsi:type="select" required="true" visible="true">
                            Select View Type
                            <options>
                                <option name="default" value="widget/viewed_grid.phtml" selected="true">
                                    Grid View
                                </option>
                                <option name="list" value="widget/viewed_list.phtml">
                                    List View
                                </option>
                            </options>
                        </parameter>
        </parameters>
    </widget>
</widgets>

  Technologymindz/Instagramfeed/view/frontend/widget/viewed_list.phtml

<?php
echo $this->getTmview_type();
echo 'Welcome';
?>

Data output not showing for viewed_list.phtml but if i set something in Block _toHtml()function than it shows.

public function _toHtml()
    {
        return '
Hello world!
';
    }

Hope this is clear, I want to manage output in .phtml not in Block


texts:
I have filed 'read' in alireza_checkingout_checkingout table I want to add condition if read =0 in query below, I alreadt tried ->addFieldToFilter('read', array('eq' => 0)) but the system return an error "fatal error: Call to a member function getBackend() on boolean in /var/www/html/megadump/app/code/core/Mage/Eav/Model/Entity/Abstract.php on line 816"

$collection = Mage::getResourceModel('customer/customer_collection')

 ->addNameToSelect()
 ->addAttributeToSelect('email')
 ->addAttributeToSelect('created_at')
 ->addAttributeToSelect('group_id')
 ->joinTable('alireza_checkingout_checkingout','alireza_customer_id=entity_id',array('alireza_customer_id','read'),null,'left')
 ->joinAttribute('billing_postcode', 'customer_address/postcode', 'default_billing', null, 'left')
 ->joinAttribute('billing_city', 'customer_address/city', 'default_billing', null, 'left')
 ->joinAttribute('billing_telephone', 'customer_address/telephone', 'default_billing', null, 'left')
 ->joinAttribute('billing_region', 'customer_address/region', 'default_billing', null, 'left')
 ->joinAttribute('billing_country_id', 'customer_address/country_id', 'default_billing', null, 'left');
 $collection->getSelect()->columns('count(alireza_customer_id) as cc')->group('entity_id');
 $this->setCollection($collection);

 return Mage_Adminhtml_Block_Widget_Grid::_prepareCollection();


texts:
I want to use Magento only for virtual products. I don't want any shipping methods, other product types, wishlist, compare, and all. I'm not sure what are all the core modules I have to disable to make the site faster. Because I'm not going to use all the other things. My flow is below.

The customer sees virtual products and selects the products.
Log in using social media.
Pays money and completes orders.


texts: Cannot process definition to array for type tinytext in Magento 2.3.0

texts:
I'm getting following error "Cannot process definition to array for type tinytext" on Magento 2.3.0 when executing php bin/magento setup:upgrade command.

Thanks


texts: Duplicate sales order grid to custom admin page

texts: I need to copy the sales_order_grid table to a custom admin page. Is there a way to do so using Magento's API?


texts: Pagination - How to add code to first page only

texts:
Please could someone point me in the right direction of how to add code to only the first page of our paginated results (Magento categories)?

This is what I've tried so far:

if (!isset($_SERVER['REQUEST_URI']) || ltrim($_SERVER['REQUEST_URI'],'/') === '') {
    echo "test";
}


texts: Magento2: How to remove extra white background from uploaded image from admin

texts:
Extra white background appears when the image uploaded is not the same dimension where it is requested.

I used resize code for image resizing:

if (!file_exists($imageResized)) { $imageResize = $this->_imageFactory->create(); $imageResize->open($absolutePath); $imageResize->constrainOnly(true); $imageResize->keepTransparency(true); $imageResize->keepFrame(true); $imageResize->keepAspectRatio(false); $imageResize->resize($width, $height); $destination = $imageResized; $imageResize->save($destination); }

For example, the image uploaded is 200x200 and it is called somewhere at a proportion of 300x200. So the image will resize to fit for the position without being stretched out rather resizing it to the proportion with extra white space. so How remove white background?


texts: Magento Market place submit extension with licence

texts:
I have developed Magento extension that I want to upload on Magento
  marketplace.

  I have gone through the process how it works explained Here:
  https://magento.com/blog/magento-news/magento-connect-moving-marketplace

  Does marketplace allow to submit domain-specific modules?  I want to
  upload domain specific license key for my extension which I can do
  from my side but if I want to submit the same extension to marketplace
  then Magento will consider my extension?

  Do they allow to submit the Domain-based license extension?

  I have developed API based extension for which I need to set domain
  access in my API. if I remove domain specific then how can I be sure
  who has purchased my extension and to which domain I need to give
  access?

  Need suggestion what could be the solution for it.


texts:
We want to give discount at the Cross Sell pop-up when customer does an Add to Cart in the PDP page.  The cross sell pop should show discount amount and should be applied to the cart.

Rule would be:

If the main product being added to cart has a value >= $29.99 then
all the items in the cross sell are 50% off
If the main product being added to cart has a value < $29.99 then all
the items in the cross sell are 25% off

Can you please tell me how we can achieve this.?
Note: I am using Magento EE1.14.2.3

Thanks,


texts:
I'm trying to update a block in my checkout page via ajax.  However, when I call the blocks toHtml() function in the controller the code does not continue to execute.  Any suggestions? Below is the code in question.

cartController.php:

couponPostAction(){
    Mage::log('first step');
    ....
    Mage::log('second step');
    $this->loadLayout();
    Mage::log('third step');
    $totals=$this->getLayout()->getBlock('checkout.cart.totals')->toHtml();
    Mage::log('fourth step');
    $coupon_code=$this->getLayout()->getBlock('coupon.code')->toHtml();
    $response['totals']=$totals;
    $response['couponCode']=$coupon_code;
    ...
    $this->getResponse->setBody(Mage::helper('core')->jsonEncode($response));
}

There are also multiple entries of 'coupon.code' in the layout.xml (which I assume the controller somehow knows it's using.. I could be wrong though.).

checkout.xml layout:

    <block type="page/html" name="coupon.code" as="couponCode" template="checkout/cart/couponerror.phtml"/>
    ...
    ...
    <block type="page/html" name="coupon.code" as="couponCode" template="checkout/cart/couponerror.phtml"/>
    <block type="checkout/cart_totals" name="checkout.cart.totals" as="totals" template="checkout/cart/totals.phtml"/>

Contents of log:

    first step
    second step
    third step


texts:
I want to create a second website within our Magento installation but I would like it to be under the same domain as our existing website.  The only difference should be that the new website has /fr/ added to the root domain i.e.

Existing website base url: mysite.com
New website base url: mysite.com/fr/

Existing website category url: mysite.com/category-1
New website category url: mysite.com/fr/category-1

Existing website product url: mysite.com/category-1/product-1
New website category url: mysite.com/fr/category-1/product-1

Is this possible?  If so, how would I configure this?


texts: Magento 2 - CSS not working properly after installation on MacOS

texts:
I just installed Magento 2 on my mac using web setup interface. I've managed to access the admin panel and storefront but the CSS of the page does not work properly.

I have tried many of the solutions from similar threads like increasing the memory limit. No luck so far.


texts: What is the best possible way of keeping search result data in Magento?

texts:
I'm using a third party API to communicate and get data to my module. The module is to get available flight details according to the search query submitted by the user. At this point I'm getting around 10 results via API.

What is the best approach to keep these search results data until the user loggedin?

If I use registry, it may be null some times when I try to access data in some other file. So saving them in the session is the only possible way? Are there any alternatives?


texts:
How can i remove (or edit) from my store --> (- Gyps Light)
I can not understand how it was added, and especially where it took the name Gyps Light

magento 2.2.2


texts:
I am trying to get all currency conversions to round up to the nearest dollar, which I have successfully done by hacking the core Currency.php file (/app/code/core/Mage/Directory/Model/Currency.php). I know this is not a good long term solution, but I can't seem to get a proper local extender going.  Any suggestions are greatly appreciated.  Thanks.

Magento 1.9.1

Here's what I have:

app/code/local/CEM/Currencyround/controllers/RoundCurrency.php

            <?php

            class CEM_Currencyround_RoundCurrency extends Mage_Directory_Model_Currency {
              public function format($price, $options = array(), $includeContainer = true, $addBrackets = false)
                {
                /**
                 * CHANGE BELOW FOR CEMPEPTIDES ROUNDING DECIMALS UP "ceil()"
                 * */
                    return $this->formatPrecision(ceil($price), 2, $options, $includeContainer, $addBrackets);
                }
            }

app/code/local/CEM/Currencyround/etc/config.xml

            <?xml version="1.0"?>
            <config>
              <modules>
                <CEM_Currencyround>
                  <version>1</version>
                </CEM_Currencyround>
              </modules>
             <frontend>
                    <routers>
                        <CEM_Currencyround>
                            <use>standard</use>
                            <args>
                                <module>CEM_Currencyround</module>
                                <frontName>CEM_Currencyround</frontName>
                            </args>
                        </CEM_Currencyround>
                    </routers>
                </frontend>
            </config>

app/etc/modules/CEM_Currencyround.xml

            <?xml version="1.0" encoding="UTF-8"?>
            <config>
              <modules>
                <CEM_Currencyround>
                  <version>1</version>
                  <active>true</active>
                  <codePool>local</codePool>
                </CEM_Currencyround>
              </modules>
            </config>


texts: In magento 2 How to customize a sidebar additional in product details page?

texts:
In custom theme how to customize a sidebar by our requirement in product detail page.

please refer the screen shot


texts: Google Analytics stopped working after Magento update

texts:
I recently updated from Magento 1.6.2 to 1.9.2.1 and I noticed that Google Analytics stopped tracking the website since I updated.

I don't have a googleanalytics folder in my template, nor do I have googleanalytics.xml in my layout folder. I never had that either, so I don't think it should be necessary for my Google Analytics to work, right?

I looked in to tutorials like this one: https://www.siteground.com/tutorials/magento/magento_google_analytics.htm and I noticed that the Google API module in that picture has a lot more options than I have in mine, so maybe I should update the module?


texts: How can I determine the image path from a product

texts:
We have actual more and more problem with showing product images. As it shows the "default" image from Magento and no the product image.

And this everywhere on the whole page:

Here is the link: https://mag.outdoorequipped.com/fashion/

I know that I have images on the server, as I see them per ftp and in the back end. But just not showing anything in the frond end on the products.

How I can test it to see the path of a product image?


texts: Data migration tool [ERROR]: Integrity check failed due to "core_config_data" document does not exist in the destination resource

texts:
I'm starting with a blank M2 data with no extensions installed. Using the data migration tool from ce 1.9.3.1 to ce 2.3.4 with the following command

php bin/magento migrate:settings --auto vendor/magento/data-migration-tool/etc/opensource-to-opensource/1.9.3.1/config.xml

I receive error

[2020-04-13 22:14:00][ERROR]: Integrity check failed due to "core_config_data" document does not exist in the destination resource

In Mysql.php line 110:

  SQLSTATE[42S02]: Base table or view not found: 1146 Table 'i2120969_db1.db_core_config_data' do
  esn't exist, query was: SELECT COUNT(*) FROM `db_core_config_data`

In Mysql.php line 91:

  SQLSTATE[42S02]: Base table or view not found: 1146 Table 'dataname_db1.db_core_config_data' doesn't exist

The 2.3.4 data has a prefix of db_ indicated in the config.xml
<options>
    <map_file>etc/opensource-to-opensource/1.9.3.1/map.xml</map_file><dest_prefix>db_</dest_prefix>
I applied the fix in MC-31156 https://github.com/magento/data-migration-tool/commit/387e04f80dc55da2481015c807c158b63646a68a
with the same result
the file core_config_data is already in map.xml to be ignored

I have been working on this for hours and can't find anyone online who has gotten by this error. If anyone has any suggestions it would be appreciated.


texts: How to get custom table next id to be saved?

texts:
In magento1 - My scenario is saving an image to a folder. Why I am using id is I have to save a lot of items (images, pdf) into the same folder as it is all related to this item.
When new data is created I want to save the file in that data id -> for supposing I have already 4 items then added fifth then I can check total rows and increment 1 and make a folder. But suppose I deleted the fifth item and adding another item so the primary key - unique id to be saved in DB will be 6 and not five.
I can use

Mage::getModel('productlabel/productlabel')->save()

and get id by

Mage::getModel('productlabel/productlabel')->getId()

but not preferred as it might get delay/error in saving then already the values will be saved and the files will not be.
I used the following but it is all returning null values

Mage::getModel('productlabel/productlabel')->getNextId();
Mage::getModel('productlabel/productlabel')->getLastId();

Is there any method to get the next id to be saved in table.

EDIT: IS there any method to get the same. Send a reply ASAP as i am stuck with it for past 2 days.


texts: Magento 2.3 add custom block under each product in category page

texts:
I need to overwrite the product listing (category) page, a custom form needs to show after that product information.

So I have found that already an extension is overwriting that page as below

<referenceBlock name="category.products.list">
        <action method="setTemplate">
            <argument name="template" xsi:type="string">Custom_ModuleName::list.phtml</argument>
        </action>
    </referenceBlock>

How to add that custom form after the each products from my custom module?

Please advise.


texts: Category, product and admin pages won't work without index.php in link

texts:
In order to enter in category, product or admin i need to specify index.php.

So linsk look like this site.dev/index.php/category_name.
I m using apache server.


texts: Product CSV file not exporting from admin in Magento 2

texts:
When we export Procuct Csv from admin side.
Then csv not export.
We get error

  There is no data for the export.

Any one help me to solve this issue.


texts: After Update to Magento 1.9.2.4 and SUPEE-10415 no card items

texts:
After Update to Magento 1.9.2.4 and SUPEE-10415 we have no card items, after adding products to the basket.

Is there any know issue ( f.e. Form-Key ) which we can check?

Thanks!


texts: Get collection with view count from and to

texts:
I'm trying to get a collection with all the product, and add the view count but only for the last 3 month.
here is me request to get all the product

$this->getSelect()->reset()->from(
                ['e' => $this->getProductEntityTableName()]
            )->joinLeft(
                ['report_table_views' => $this->getTable('report_event')],
                'e.entity_id = report_table_views.object_id',
                ['views' => 'COUNT(report_table_views.event_id)']
            )->group(
                'e.entity_id'
            );

if ($from != '' && $to != '') {
            $this->getSelect()->where('report_table_views.logged_at >= ?', $from)->where('report_table_views.logged_at <= ?', $to);
        }

Result

product 1 - 10 view
product 2 - 5 view

expected result

 product 1 - 10 view
 product 2 - 5 view
 product 3 - 13 view
 product 4 - 7 view

product 3 and 4 get cut out because of the where condition. I would like the where condition to only apply to the COUNT(report_table_views.event_id)


texts:
I know this is a very simple question, but I couldn't get it to run, even if I read some tutorials.

I want to rewrite _saveProductCategories() from Mage_ImportExport_Model_Import_Entity_Product.

What I've done is create an empty class: app/core/local/MyNamespace/MyModule/Model/Import/Entity/Product.php with class name MyNamespace_MyModule_Model_Import_Entity_Product to extend the core model class. There I've put my implementation of the current function that I want to rewrite.

Then in the config.xml of myModule I have:

    <global>
            <models>
                <mymodule>
                    <class>MyNamespace_MyModule_Model</class>
                </mymodule>
                <importexport>
                    <rewrite>
                        <import_entity_product>MyNamespace_MyModule_Model_Import_Entity_Product</import_entity_product>
                    </rewrite>
                </importexport>
            </models>
...

But it still uses the function from the core code. What am I doing wrong?


texts:
Just wondering is there an easy way to change currency based on a user location? So if someone from Germany visits the site, prices automatically change to Euros and someone from USA prices automatically change to dollar.

Is this possible in Magento or will we have to use an extension to perform this?

Thanks,


texts:
I created a custom Theme for our shop which works pretty fine.

Just one thing is bothering me: I created some words in the footer and want to link them to custom pages which only have static content. For example (just for better understanding) let's assume I created a link in the footer called "FAQ", when you click on it you will be redirected to https://my.shop/faq -> and this is a static page using my custom (let's call it) faq.phtml template.

I only found examples for custom m2 modules (containing routes blocks and controllers) but not for a theme. Also, I don't need functionality there. I simply want to show my static template.

Is there a tutorial or description for this case? I only found how to extend/overwrite available templates, bot not how to create a new one.

Thanks in advance!


texts: Magento2 : Display Bestselling products for last 7 days

texts:
I want to display bestselling products for time inetrval 7 days. We can set period by day, month and year

$bestSellers = $this->_bestSellersCollectionFactory->create()
            ->setPeriod('day');

Can we set the date range to show only products from last 7 days like we set in admin