texts: Recevied Empty array after using getItemsByColumnValue() collection method

texts:
I'm trying to retrieve a row from a custom table named 'lmap_shipping_tablerate' using a specific value for a column postcode.

An empty array is returned when following line is used in my ResourceModel php file.

use MyVendor\MyModule\Model\Carrier\ResourceModel\Shipping\CollectionFactory;
$postcode_rate_row = $this->collectionFactory->create()->getItemsByColumnValue('postcode', $value);
$this->logger->debug('Rates received: '.var_dump($postcode_rate_row));

Below is the directory structure

Am I using the collection factory in correct manner.

I have also created a helper file to get the desired row and used the same above code to return the array back to the calling method in ResourceModel php file but again empty array is received.


texts: How to get Customer's Order using Magento 2 Rest API?

texts: I want to know is there any REST API available to get customer's Order in Magento 2?


texts: set page size on collection while only getting in-stock items

texts:
how do i load a collection in magento that is limited to 10 products but only includes products that are in stock?

what i tried

1:

$productCollection = Mage::getModel('catalog/product')
            ->getCollection()
            ->setPageSize(10);

 Mage::getSingleton('cataloginventory/stock')
       ->addInStockFilterToCollection($productCollection);
 // problem with this method - if one of the ten items are not in stock my
 // collection only has 9 items

problem with this method - if one of the ten items are not in stock my collection only has 9 items

2:

$collection = Mage::getModel('catalog/product')
 ->getCollection()
 ->addAttributeToSelect('*')
 ->joinField('qty',
             'cataloginventory/stock_item',
             'qty',
             'product_id=entity_id',
             '{{table}}.stock_id=1',
             'left')
 ->addAttributeToFilter('qty', array("gt" => 0));
// problem with this method - configurable parent products don't have stock
// (only the children do), this causes the parents not to show

problem with this method - configurable parent products don't have stock (only the children do), this causes the parents not to show

Any suggestions?

Solution

Here is a more fleshed out version of the correct answer below:

$collection = Mage::getModel('catalog/product')
     ->getCollection()
     ->addAttributeToSelect('*')
     ->joinField('is_in_stock',
            'cataloginventory/stock_item',
            'is_in_stock',
            'product_id=entity_id',
            '{{table}}.stock_id=1',
            'left')
        ->addAttributeToFilter('is_in_stock', array("eq" => 1))
        ->setPageSize(10);


texts: Magento 2: Upsell programmaticly add products only adds last item

texts:
I am trying to add upsell products automaticly with the Magento\Catalog\Api\Data\ProductLinkInterfaceFactory class, I added following code:

EDIT CODE IS UPDATED WITH AN WORKING EXAMPLE

        $i = 100;

        foreach ($collection as $item) {
            $productLink = $this->productLinkInterfaceFactory->create();
            $productLink->setSku($product->getSku())
                ->setLinkedProductSku($item->getSku())
                ->setPosition($i++)
                ->setLinkType('upsell');

            $linkData[] = $productLink;
        }

        if ($linkData) {
          $product->setProductLinks($linkData);
          $product->save();
        }

I tried solving it with the following similar post: link

But no result.
It only adds the last product, anybody knows how to add all products?


texts:
I want to add  New currency which is displaying in the currency Setup tab in the back-end.

I want to add Points Currency and apply  to the entire store.
Can anyone please help me ??
Thank you!!!


texts: Upgrading Existing Store from Magento Enterprise edition version 1.12 to version 1.14

texts:
We have a Magento Web Store build with Magento Enterprise Edition version 1.12. We are planning to upgrade it to version 1.14. We understand that we will need to do an incremental upgrade i.e. from 1.12 to 1.13 first and then from 1.13 to 1.14. I have a few questions regarding this as below:

Is the plan correct about doing incremental upgrade rather than direct to 1.14?
We are planning to do the upgrade via Magento Connect rather than manual or through ssh, should that be ok?
Our store has around 81 extensions including paid/free, some of them we developed, so does this mean it would be more difficult. Note: only a few are customized and most of them are not and compatibility checks already done.
If we go for incremental upgrade, does it mean, we have to pay for version 1.13 too?
We have identified following steps, does it make sense or any other/better way to do this?

Backup of complete site and DB and create a new instance where upgrade will happen.

list all extensions and details about them like paid/free, customized/not, licenses etc.

Do the following steps on the new instance created for upgradation.

Enable exceptions logging in the system
Flush Magento Cache & disable it.
Making sure all crons are disabled.
Make sure built-in compiler is disabled if enabled
Modifying indexers settings to update when scheduled rather than automatic
Complete the Upgrade as per Magento Steps using Magento connect.
Deprecation errors may come due to PHP pugradation which needs to be handled
Delete file named maintenance.flag from root
Changing URLs based on changes to 1.13 using URL redirect scripts.

  [Magento install dir]/php -f shell/url_migration_to_1_13.php -
  thread-count. thread-count is the number of CPU cores in Magento
  server, minus 1, to a maximum of 15

Full re-indexing from command line.

  [Magento install dir]/php -f shell/indexer.php — –reindexall

Make sure to check if all URLs work in this instance
clear [Magento install dir]/var/cache /var/full_page_cache /var/locks
enable crons, enable cache, modify indexer settings and make it default (update when scheduled) and delete the /var directory.
If built-in compiler was disabled then re-enable it
Review all extensions one by one and compare functionalities related to each extensions with Live instance and make sure they work as they should on upgraded version
Making sure all custom code is applied to the upgraded version
Verify complete web store functionalities are working

I would appreciate some insight on this. Are we missing anything here?


texts: Magento2 - Attribute value not update while csv import

texts:
I want to update the additional_attributes values from csv file in Magento2,the attribute name is : manufacturer and It have 30 values,and It's showing on product catalogue page in a drop down. So It's not updating the value,but another attributes updating fine.
So why this attribute value not updating?
I also tried with another Magento2 site but its working fine.
So what is the reason and why its not updating?


texts: After php 7 update magento 1.8 product images not appearing in admin

texts:
After PHP 7 update magento 1.8 product images not appearing in admin panel on google chrome.

But its appearing in fire fox.

This following image in Chrome

How can i fix this..?


texts:
In these few days, I have tested magento2 bundle product function in a multi-site magento2.
However, there is a problem.

First, I have two sites which are TW and US.
I followed the document in Magento website for setting up a test bundle product.

  http://docs.magento.com/m2/ce/user_guide/catalog/product-create-bundle.html

I am able to find that product in TW but not in the US.
And then I directly accessed that product page, I found It is out of stock.
But I have set as in stock.

Please give me some advice.

Thank you


texts: Can magento store information about the vendors from which you acquire inventory natively?


texts: Custom mega menu by overriding Topmenu.php

texts:
I can't find a good mega menu on the web. I want a mega menu which shows thumbnail categories directly in the dropdown menu.

But I can't find it, I tried many mega menu but they didn't work.

So I want to know if it's possible to do it myself, and if so, how to achieve it. Thanks

EDIT

It's inside the Topmenu.php file (in module-theme folder).

By default we have this :

            $html .= '
_getRenderedMenuItemAttributes($child) . '>';
            $html .= 'getUrl() . '" ' . $outermostClassCode . '>' . $this->escapeHtml(
                    $child->getName()
                ) . '' . $this->_addSubMenu(
                    $child,
                    $childLevel,
                    $childrenWrapClass,
                    $limit
                ) . '
';

And I want something like this :

            $html .= '
_getRenderedMenuItemAttributes($child) . '>';
            $html .= 'getUrl() . '" ' . $outermostClassCode . '>' . $this->escapeHtml(
                    $child->getName()
                ) . ''.$child->getThumbnail().'' . $this->_addSubMenu(
                    $child,
                    $childLevel,
                    $childrenWrapClass,
                    $limit
                ) . '
';

where $child->getThumbnail is the thumbnail of the category


texts: Magento 2 How to create admin form through UI Component

texts:
I want to build a simple magento 2 backend form.

What is the most appropriate way to do this?

  With form UI Component or with a phtml template.

The form just make some action and NOT saving data to database.
No CRUD operations, NO Data Entities... Just some controller actions when submit form.


texts: How to auto sort simple products by Price attribute on Configurable product?

texts:
So I have a configurable product which pulls certain attributes from the simple product using this code:

if($_product->getTypeId() == "configurable"):
$conf = Mage::getModel('catalog/product_type_configurable')->setProduct($_product);
$simple_collection = $conf->getUsedProductCollection()->addAttributeToSelect('*')->addFilterByRequiredOptions();
foreach($simple_collection as $simple_product){
    echo $simple_product->getSku() . " - " . $simple_product->getName() . " - " . Mage::helper('core')->currency($simple_product->getPrice()) . "<br>";
}

This works perfectly.

What I want it to do now is sort the products by price, with the lowest at the top.

I am a noob, so if anyone can help me with it and modify the code for my needs, you will be a life saver :)

Thanks in advance


texts: Set Route FrontName dynamically in Controller

texts: Is there anyway to override the default front-name inside routes.xml and change it dynamically in the controller like setFrontName(%frontname%)?


texts: How to add multiple configurable products add to cart with size and color options in magento 2

texts:
I am trying to add to the cart multiple configurable products with color and size options.
when adding configurable products (with any children) product prices are displayed correctly only in the first configurable product... the others show price 0$
when adding different children of same configurable product only the first is being added to cart (with qtys of others being added to that first child).
Can you lead me to the error in the controller code, or any missing code required to be added?
<?php
namespace Vendor\Module\Controller\Product;

use Magento\Framework\App\Action\Context;
use Magento\Framework\View\Result\PageFactory;
use Magento\Framework\Controller\Result\JsonFactory;

class AddToCart extends \Magento\Framework\App\Action\Action
{
    /**
     * Result page factory
     *
     * @var \Magento\Framework\Controller\Result\JsonFactory;
     */
    protected $_resultJsonFactory;
    protected $cart;
    protected $productRepository;
    protected $productFactory;
    protected $_storeManager;
    protected $formKey;
    /**
     * @param Context $context
     * @param PageFactory $resultPageFactory
     */
    public function __construct(
        Context $context,
        JsonFactory $resultJsonFactory,
        \Magento\Checkout\Model\Cart $cart,
        \Magento\Catalog\Api\ProductRepositoryInterface $productRepository,
        \Magento\Catalog\Model\ProductFactory $productFactory,
        \Magento\Store\Model\StoreManagerInterface $storeManager,
        \Magento\Framework\Data\Form\FormKey $formKey
    )
    {
        parent::__construct($context);
        $this->_resultJsonFactory = $resultJsonFactory;
        $this->cart = $cart;
        $this->productRepository = $productRepository;
        $this->productFactory = $productFactory;
        $this->_storeManager = $storeManager;
        $this->formKey = $formKey;
    }
    public function execute()
    {
        $resultJson = $this->_resultJsonFactory->create();

        $params = $this->getRequest()->getParams();
        $productId = isset($params['product']) ? (int)$params['product'] : 0;
        $storeId = $this->_storeManager->getStore()->getId();
        try {
            if($productId > 0 && isset($params['options']) && !empty($params['options'])){
                $_product = $this->productFactory->create()->setStoreId($storeId)->load($productId);
                foreach ($params['options'] as $option) {
                    $options = array(
                        $option['color_attribute_id'] => $option['color_option_id'],
                        $option['size_attribute_id'] => $option['size_option_id']
                    );
                    $params = array(
                        'form_key' => $this->formKey->getFormKey(),
                        'product' => $productId,
                        'super_attribute' => $options,
                        'qty' => $option['qty']
                    );
                    $this->cart->addProduct($_product,$params);

                }
                $this->cart->save();
                $response = array(
                    'status'=> 'success',
                    'message'=>__('Items added to cart.')
                );
            }else{
                $response = array(
                    'status'=> 'error',
                    'message'=>__('No items found, please try again.')
                );
            }
        }
        catch(\Exception $e) {
            $response = array(
                'status'=> 'error',
                'message'=>$e->getMessage()
            );
        }
        return $resultJson->setData($response);
    }
}


texts: Class 'Mage_Adminnotification_Helper_Data' not found (when it is actually present)

texts:
Every so often we keep getting the error:-

PHP Fatal error: Class 'Mage_Adminnotification_Helper_Data' not found in /var/www/vhosts/domain.co.uk/httpdocs/app/Mage.php on line 546

This causes the backend to produce a 500 Internal Server Error and the above error gets logged each time you try to access a URL in the backend.

Upon inspection though, everything in app/code/core/Mage/AdminNotification is present and completely intact.

To fix the issue, I grab another copy of the above path from a working store and overwrite this one. Clear cache and then fixed, can access backend again.

I've run a compare between the AdminNotification folder and all it's contents for the version that we replaced with and the version that was replaced. Every single thing in both folders are identical. Yet replacing with what was already there fixed the problem. Odd.

Is it possible that a 3rd party extension that serves inbox notifications in the backend could be the cause of this somehow? Maybe trying to extend this class incorrectly or something along those lines? Your advice/suggestions is greatly appreciated.


texts: How to create an event in observer which fired after adding customer in Magento 2.1.6?

texts:
I am new in Magento and want to create an observer (event) which should fire after adding a customer. I tried below tutorial but not working:
https://webkul.com/blog/observers-in-magento2/

I created folders and files as described in this but that is not working.
Any help will really appreciable.

Thanks in advance.


texts: The value entered in the default value field of attribute is not getting displayed

texts:
I created a new attribute with Catalog Input Type for Store Owner as Text Area. Then I entered some code in the default value field. Now While creating a new product the filed of the attribute I created is empty instead of displaying the code which I have entered in the default value field.

The code which I have inserted is this,

Should I do anything additionally? Someone guide me please.


texts: How to show the grouped product total price on qunatity change?

texts:
I am working on a project.

I want to show the total price of the grouped product when we add the simple products using ajax.


texts: Can we Pass Jquery Value in PHP Function of Block. Magento 2

texts:
I want to pass the value of jquery in PHP function is it possible to send the value. like for example I have a textbox and in textbox when the user add 5 then it instantly send to the php function after that when the user add 56 then the value is been send to the PHP function... I was trying but its not working for me.. my code is

<?php
$block->storeInAlgolic();
?>

Animated search form:

<form type="POST">
    <input type="number" id="order_search" name="searchh" placeholder="Search Order by Order_ID">

<input type="text" id="textbox2"/>

<input type="text" id="textbox3"/>
</form>

the output is like

is there is any possible way to send Jquery instantly to php function?


texts: How to get all the customer wishlist items in magento

texts:
I want to get all the product ids from wishlist in magento. I tried with below code but I am getting only one product id.

public function GetWishlistProductId($productId)
{
    $customer = Mage::getModel('customer/customer')->getCollection()->addAttributeToSelect('*');

    $wishList = Mage::getModel('wishlist/wishlist')->loadByCustomer($customer);
    $wishListItemCollection = $wishList->getItemCollection();

    if (count($wishListItemCollection)) {
        $arrProductIds = array();

        foreach ($wishListItemCollection as $item) {
            /*@var $product Mage_Catalog_Model_Product */
            $product = $item->getProduct();
            $arrProductIds[] = $product->getId();

            foreach ($arrProductIds as $key => $val){
                if($productId == $val){
                    $pval=$val;
                }
            }
        }
    }
    return($pval);
}


texts: how to get products collection in block magento 2?

texts:
Actually I am trying to get products collection in block using
  resource model class here I want to get the price of the first product if
  product is configurable Magento 2.

<?php
namespace Vendor\Module\Block;

class Catproduct extends \Magento\Framework\View\Element\Template
{
    protected $_storeManager;
    protected $_productCollectionFactory;
    protected $registry;
    protected $_urlInterface;

    public function __construct(
        \Magento\Backend\Block\Template\Context $context,
        \Magento\Catalog\Model\ResourceModel\Product\CollectionFactory $productCollectionFactory,
        \Magento\Store\Model\StoreManagerInterface $storeManager,
        \Magento\Framework\Registry $registry,
        \Magento\Framework\UrlInterface $urlInterface
    )
    {
        $this->_productCollectionFactory = $productCollectionFactory;
        $this->_storeManager = $storeManager;
        $this->registry = $registry;
         $this->_urlInterface = $urlInterface;
        parent::__construct($context);
    }

    public function getCategoryProducts($catalog_ids)
    {
        $collection = $this->_productCollectionFactory->create();
        $collection->addAttributeToSelect('*');
        $collection->setPageSize(9); // fetching only 3 products
        $collection->addCategoriesFilter(array('in' => $catalog_ids));
        $collection->load();
        return $collection;
    }

}
?>


texts: Can i edit the range price layer by code?

texts:
My catalog product use 3 Columns Layout:

The layered navigation in the right
The product in the center
The cart in the left

All work very well but i have a problem when that the maximum price of product in the category are lower than the range price, the layered Navigation is not displayed and the left section is empty.

For example, if in my category i have five products and the maximum price between there products are $70.00 and the range price is 100 i have this problem.

I know that the range can be edited in admin panel : system>configuration>catalog>layered navigation.

I found the file when magento return me the range : /app/code/core/Mage/Catalog/Model/Layer/Filter/Price.php

 public function getPriceRange()
    {
        $range = $this->getData('price_range');
        if (is_null($range)) {
            $maxPrice = $this->getMaxPriceInt();
        $index = 1;
            do {
                $range = pow(10, (strlen(floor($maxPrice))-$index));
                $items = $this->getRangeItemCounts($range);
                $index++;
            }
            while($range>self::MIN_RANGE_POWER && count($items)<2);

            $this->setData('price_range', $range);
        }
        return $range;
    }

Can i edit this code to adapt in my situation. Can edit the price range according the maximum product price in the category ?

or if i have this problem can i transform my catalog design from 3 Columns Layout to 2 Columns Layout with any code?

Thanks


texts: how can i fetch only last order id placed in my magento2 store in api?

texts:
Hi i have a an api file for fetching orders coming in my magento2 store , this is the code below which is successfully fetching my order number 66 from database , **`

  i wants to know how can i fetch only last order placed in my list ?

`** so that i can get all upcoming latest orders.

<?php
$adminUrl='http://host.pk/index.php/rest/V1/integration/admin/token';
$ch = curl_init();
$data = array("username" => "user11", "password" => "pass11");
$data_string = json_encode($data);
$ch = curl_init($adminUrl);
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, "POST");
curl_setopt($ch, CURLOPT_POSTFIELDS, $data_string);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_HTTPHEADER, array(
    'Content-Type: application/json',
    'Content-Length: ' . strlen($data_string))
);
$token = curl_exec($ch);
$token=  json_decode($token);

//Use above token into header
$headers = array("Authorization: Bearer $token");

$requestUrl='http://host.pk/index.php/rest/V1/orders/66';

$ch = curl_init();
$ch = curl_init($requestUrl);
curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);

$result = curl_exec($ch);
$result=  json_decode($result);

 echo "<pre>";
 print_r($result);
echo "</pre>";
?>


texts: Magmi base image include in gallery being ignored

texts:
I'm using Magmi 0.7.21 and Magento CE 1.9.2.1 with Magmi being run through the datapump API.

When importing my products I'm making sure to have the "+" added in front of the base image path, but this doesn't result in my base images having the "exclude" checkbox unticked in admin for some reason.

I have tried setting "Image import mode" to "overwrite" in Magmi config.

Everything else to do with the Image attributes processor seems to work as advertised.

Does anyone have any tips or could anyone confirm that this works with the API?  The documentation is pretty clear about how to achieve this and I've followed it to the letter as far as I know, but no joy.

[update]

I can work around this using the following after import.  May be useful to anyone else with the same issue.

public function updateGalleryExclude($arg_skus)
{
    $query = 'UPDATE `catalog_product_entity_media_gallery_value` AS a
        INNER JOIN `catalog_product_entity_media_gallery` AS b ON a.value_id = b.value_id
        RIGHT JOIN `catalog_product_entity` AS c ON c.entity_id = b.entity_id
        SET a.disabled = 0
        WHERE c.sku IN ("' . implode('", "', $arg_skus) . '")
        AND a.disabled = 1';

    $result = $this->db->query($query);

    return $result;
}


texts: MAgento2.3.0 how to Update automatic indexing - cron job to set up to re-index automaticaly/periodically

texts:
I am using MAgento2.3.0 website i need  to  Update automatic indexing - cron job to set up to re-index automaticaly/periodically

if any one idea how to setup please reply me


texts: How can I default the "Append Comments" checkbox to unchecked when creating new order in backend?

texts:
When a member of our staff creates a new order in the Magento backend, they frequently add comments into the order but forget to uncheck the "Append Comments" checkbox on the order.  Sometimes we don't want the customer to see those comments in the order email, and would prefer to have that checkbox default to unchecked.

How can I change that?

Here is a screenshot of what I mean:


texts: Magento prototype.js and stuck in checkout

texts:
After upgrading our shop to 1.9.2 the checkout doesn't work. The whole process continues, but when I click "place order" it gets stuck in "submitting order information".

Before I can see these errors in Chrome.

Would be really great if you could help. Been searching on the web for days. I would be really grateful for every idea.


texts: Marketplace solution with Multiple website and website specific price for product

texts:
I have requirement for developing the marketplace solution where there are more than 500 website store each have common/separate products.

Website admin can update the product price for their store or can create the new product. As in magento if there are multiple website and website specific price and if we change the inventory or product price, it will require the indexing. And If there are more than 500 website and lots of product, it requires indexing and indexing may have issue or it can take time.

How can I get rid of the indexing issue ?

So how can I developed such type of solution ? Or will it possible to go with the magento ? Will magento handle this such type of solution ?


texts: Magento special price is showing zero by default

texts:
I'm working on a site in magento where all product's special prize is showing zero by default, though I didn't set any special price for products.

for example,it showing->

Regular Price: $755.00

Special Price: $0.00

how to hide those special prices and make visible only for those products where special price is applicable? otherwise the default price should be shown.


texts: 0000-00-00 00:00:00 datetime is showing incorrectly in magento admin grid filter

texts:
I am using datetime grid filter in my custom module grid. I use following code-

$this->addColumn('created_at', array(
            'header' => Mage::helper('po')->__('Created At'),
            'align' => 'center',
            'width' => '10px',
            'type' => 'datetime',
            'index' => 'created_at',
        ));

if a row in database contains datetime  0000-00-00 00:00:00 then the value in grid column is showing Nov 30, -1 5:30:00 AM besides showing 0000-00-00 00:00:00. but if a row in DB contains a value in datetime column then exact time is being shown in grid column.  How it can be corrected.?


texts: How to get the product image in invoice email template?

texts:
I have succeeded in getting the product image in the new order email template (<Vendor>/<Theme>/Magento_Sales/templates/email/items/order/default.phtml) using the following:

<img src="<?= $this->helper('Magento\Catalog\Helper\Image')
                ->init($_item->getProduct(), 'product_thumbnail_image')
                ->constrainOnly(TRUE)
                ->keepAspectRatio(TRUE)
                ->keepTransparency(TRUE)
                ->keepFrame(FALSE)
                ->resize(200, 260)->getUrl(); ?>" alt="<?= $block->escapeHtml($_item->getName()) ?>" width="100">

But whenever I try the same code in the invoice template (<Vendor>/<Theme>/Magento_Sales/templates/email/items/invoice/default.phtml) I receive the following error:

PHP Fatal error:  Uncaught Error: Call to a member function getData() on null in /var/www/public/vendor/magento/module-catalog/Helper/Image.php:500
Stack trace:
#0 /var/www/public/vendor/magento/module-catalog/Helper/Image.php(470): Magento\\Catalog\\Helper\\Image->initBaseFile()
#1 /var/www/public/vendor/magento/module-catalog/Helper/Image.php(528): Magento\\Catalog\\Helper\\Image->applyScheduledActions()
#2 /var/www/public/app/design/frontend/Falak/englishfalak/Magento_Sales/templates/email/items/invoice/default.phtml(30): Magento\\Catalog\\Helper\\Image->getUrl()
#3 /var/www/public/vendor/magento/framework/View/TemplateEngine/Php.php(59): include('/var/www/public...')
#4 /var/www/public/vendor/magento/framework/View/Element/Template.php(270): Magento\\Framework\\View\\TemplateEngine\\Php->render(Object(Magento\\Sales\\Block\\Order\\Email\\Items\\DefaultItems\\Interceptor), '/var/www/public...', Array)
#5 /var/www/public/generated/code/Magento/Sales/Block/Order/Email/Items/DefaultItems/Interceptor.php(180): Magento\\Framework\\View\\Element\\Templa in /var/www/public/vendor/magento/module-catalog/Helper/Image.php on line 500, referer: http://lifestyley.localhost/admin/sales/invoice/view/order_id/123/invoice_id/4/key/ca0c7bf344bba27a0ed4dc1353f1f81c98c4c30764c9640ff79dd10108313c75/

Why it's not working in the invoice template but working on the order template?

The variable $_item is there in both of them and is retrieved in the same way in both cases. And in both files, I'm using several functions on this variable successfully. The only problem seems when I try to retrieve the products pictures.


texts: How can make jquery ajax controller in magento 2

texts:
I am not able to find correct approaches to done this work. I found some resources but there they guys are using model files also but they didn't explain about that files. My codes are below

Controller file

namespace Vendor\Modulename\Controller\Index;

use Magento\Framework\App\Action\Action;
use Magento\Framework\App\Action\Context;
use Magento\Framework\View\Result\PageFactory;
use Magento\Framework\Controller\ResultFactory;

class Index extends Action
{
    /**
     * @var \Tutorial\SimpleNews\Model\NewsFactory
     */
    protected $resultJsonFactory;
    protected $resultPageFactory;

/**
 * @param Context $context
 * @param NewsFactory $modelNewsFactory
 */

public function __construct(
        Context                                             $context,
        \Magento\Framework\Controller\Result\JsonFactory    $resultJsonFactory,
        PageFactory $resultPageFactory
    ) {
        $this->resultPageFactory = $resultPageFactory;
        $this->resultJsonFactory            = $resultJsonFactory;
        parent::__construct($context);
    }

   public function execute() {

    $result = $this->resultJsonFactory->create();
    if ($this->getRequest()->isAjax()))
    {

        $test=Array
        (
            'Firstname' => 'What is your firstname',
            'Email' => 'What is your emailId',
            'Lastname' => 'What is your lastname',
            'Country' => 'Your Country'
        );
        return $result->setData($test);
    }
}
}

Template file

data = jQuery(this).serialize();
            jQuery.ajax({
               showLoader: true,
                type: "POST",
                dataType: "json",
                contentType: "application/json",
                url: "modulename/index/index",
                data: "label=" + abc,
                success: function (result) { jQuery('#result').html(result); },
                error: function (error) { alert(error); }

Please somebody guide me


texts: I've got a fresh magento 2 installation on a virgin test system, but I can't find the settings for a smtp connection. How do you manage email communication in magento 2?


texts: display product name in admin grid in magento2

texts: I want to display product name in that column


texts: Is my site required to upgrade to 1.9.3.3 or Apply Patch

texts:
My site is currently on CE 1.9.2.4, is using Paypal but not using Paypal Instant Payment Notification.  I read somewhere that all merchants using Paypal MUST upgrade to 1.9.3.3 or apply SUPEE-8167 by June 30, 2017 to avoid service disruptions.

Since I am not using Paypal IPN, will my site really face disruptions if I don't do anything?  I prefer to not touch my site for now if the Paypal IPN change does not affect me.  Hopefully someone could clarify the sweeping "all merchants must upgrade" statement, since not all are using Paypal IPN.


texts: Search not efficient after enable flat catalog Products/Categories

texts:
After i enabled flat catalog Products/Categories, search not return appropriate values, sku search completely not working, name search partially working.

  Notes :

   am using Ajax search Extensions


texts: Event for before invoice creation magento 2

texts:
Do we have any event for invoice before create?

When we click on invoice and about to submit the form , do we have any event there?

Want to do some modification before creating invoice.


texts: How Can I sent Email from magento Observer to MailHog?

texts:
I caught data $email and $comment that I must send

<?php

namespace Dev\ProductComments\Observer;

use Magento\Framework\Event\ObserverInterface;
use Magento\Framework\Event\Observer;

class EmailObserver implements ObserverInterface
{

    public function __construct()
    {
        // Observer initialization code...
        // You can use dependency injection to get any class this observer may need.
    }

    public function execute(\Magento\Framework\Event\Observer $observer)
    {
        $email = $observer->getData('sentEmail');
        $comment = $observer->getData('sentComment');

    }

}


texts: In the admin panel of Magento, where can I see entries of the contact us form?

texts: I have made a contact us form for my website. Where can I see the entries of data made by my customers in that form?


texts: Custom attribute saved but not loaded in collection?

texts:
I added a custom attribute is_featured to my Magento 1.7 store. Its a yes/no dropdown. I am setting it to yes on storeview level and to no on the standard level.

Now I try to load a collection with all the products that have is_featured set to yes. This is my code:

$products = $this->_addProductAttributesAndPrices($products)->addAttributeToFilter(array(array('attribute' => 'featured', 'eq' => '1')));

This only loads those products that have is_featured set to yes on both storeview and standard scope, the ones that have it set to yes on storeview only are NOT included. Why is this the case, did I miss something?


texts: Magento 2: display registration/sign in screen before checkout ONLY if specific SKU exists in basket

texts:
We have a project where in most cases we want checkout to be guest only
However, if there is a particular SKU in the cart we want the registration/sign in box to be presented when they click through from cart to checkout
At present, if we disable guest checkout, this happens for everyone
I've seen extensions out there for conditional registration, but these all seem to be around accessing specific pages and not based on the contents of the cart
Does anyone have any ideas / resources they can point me to that would help with this?


texts: Displaying Configurable Swatches in a Custom Theme

texts:
I used this solution for adding configurable swatches to my custom theme. It worked but I managed to achieve a partial result.

The problem i am facing is that i see double images on my product-view page. I have attached the screenshots for reference:

You can see that the product only has 1 image (Also shown in more views) but both the images are displaying. Also, when i hover over the topmost image it shows the elevate zoom feature. And when i hover over the below Image it uses the default zoom function of Magento. Below attached are the images of both the cases.

Hover Case-1:

Hover Case-2:

I inspected the element and noticed that there is an extra code that appears which is not in the media.phtml file. Below is the screenshot of the inspect element.
[
and below is the actual code of template/catalog/product/view/media.phtml file. You can see that i am not calling any image after the .product-image-gallery div.

    <?php
    $_product = $this->getProduct();
    $_helper = $this->helper('catalog/output');
?>

        <img id="image-main"
             class="gallery-image visible"
             src="<?php echo $this->helper('catalog/image')->init($_product, 'image') ?>"
             alt="<?php echo $this->escapeHtml($this->getImageLabel()) ?>"
             title="<?php echo $this->escapeHtml($this->getImageLabel()); ?>" />

        <?php $i=0; foreach ($this->getGalleryImages() as $_image): ?>
            <?php if ($this->isGalleryImageVisible($_image)): ?>
            <img id="image-<?php echo $i; ?>"
                 class="gallery-image"
                 src="<?php echo $this->getGalleryImageUrl($_image); ?>"
                 data-zoom-image="<?php echo  $this->getGalleryImageUrl($_image); ?>" />
            <?php endif; ?>
        <?php $i++; endforeach; ?>

<?php if (count($this->getGalleryImages()) > 0): ?>

<?php echo $this->__('More Views') ?>

    <?php $i=0; foreach ($this->getGalleryImages() as $_image): ?>
        <?php if ($this->isGalleryImageVisible($_image)): ?>

            <a class="thumb-link" href="#" title="<?php echo $this->escapeHtml($_image->getLabel()) ?>" data-image-index="<?php echo $i; ?>">
                <img src="<?php echo $this->helper('catalog/image')->init($this->getProduct(), 'thumbnail', $_image->getFile())->resize(75); ?>"
                     width="75" height="75" alt="<?php echo $this->escapeHtml($_image->getLabel()) ?>" />

        <?php endif; ?>
    <?php $i++; endforeach; ?>

<?php endif; ?>

<?php echo $this->getChildHtml('after'); ?>

In addition to this error, for the configurable products that use colour swatch, the picture doesn't get replaced & keeps on adding at the end of the previous image. As i click on the swatch color, the corresponding product image of that swatch keeps on adding at the end of the previous image. Below is the screenshot of the issue.

I want to understand how is the  tag being added to the media.phtml file & why are the images being appended at the end of the displayed image.

P.S. i have used all the default configurable swatches files from RWD theme & have not made any edits to those files.


texts: Magento 2.4.2: Google recaptcha not working on Braintree credit form

texts:
I am having a serious issue. I use the default Magento 2.4.2 google Recaptcha and it applied to the Braintree credit form at checkout.
Recaptcha showing but not working validation. They pass every time.
Any workaround or solution would be really appreciated. After many hours I still cannot make it work. Thanks.


texts: What is the file path to edit the checkout page in root?

texts: How to edit/add one new field in checkout page?


texts: Prevent new customers (never purchased anything before) from ordering specific products in Magento 2

texts:
I am in a situation that requires to prevent new customers (who never purchased before) from placing an order that contains some specific products.
These products should be available for all customers (logged in and not logged in), however when checking out, new customers shouldn't be able to complete and should receive  a custom error message.
Is there any extension that allow that?
*Additional information: the story behind this is that these products are actually refills products, and should be only available to previous customers.
Thank you


texts:
I recently found myself working with making price updates work in two places on a configurable product page. The previous dev had set up some jquery to try and catch the price updates and apply them to the button. Due to the number of configurable options, this would break very easily.

After a little digging, I found that Magento instantiates an object with all price containers that are set by default. Based on this, I felt we just needed to add an additional price container to the initPrices method on Product.OptionsPrice. I did a little reading on the Magento way of doing this, including the following article, but my methods never would over-write the default.

http://inchoo.net/magento/extending-javascript-methods-magento-way/

In the end, I was able to use the addMethods option from prototypejs to get my additional container, plus the default containers loaded up.

Id be curious how other people might approach this problem.


texts: Magento 1.9 - Looking for Sample CSV customer import File

texts:
Anyone can help me with the sample CSV format to import the "customers" from backend??

When I tried to import the exported file from
Admin > Customers > Export To > CSV.
It is showing the error like

  Can not find required columns: email, _website.

Which means headers need to be changed ?


texts: What is the proper way to do a Stress test in JMeter?

texts:
I would like to do a stress test our website with 10000 threads/users. I'm using JMeter for Stress testing the website. But, I don't know the proper way to start the test.

Initially, I have run the test with 5000 users with no ramp-up period, when I run the test, I'm getting the below error:

Response code: Non HTTP response code: java.net.SocketException

But If I put the ramp-up period while running the test, the error does not appear.

At this point, I want to know whether I have to give a ramp-up period or not while running the test.

I have read many posts about the ramp-up period, but not getting the satisfied answer.

Could anyone please help me to do a proper stress test in JMeter?

Your help will be greatly appreciated.

Looking forward to your reply.

Thanks


texts: Restore Checkout Session Data in magento 2

texts:
We are facing a session issue when returning from payment gateways(CCAvenue). It's treated as a new session on the recent version of Chrome, edge.
So, we are trying to create a session after getting back from the payment gateway. we have created customer sessions. It works fine.
if (!$customerSession->isLoggedIn()) {
    $customer_id = $order->getCustomerId();
    $customer = $_objectManager->get('Magento\Customer\Model\Customer')->load($customer_id);
    $customerSession = $_objectManager->create('Magento\Customer\Model\Session');
    $customerSession->setCustomerAsLoggedIn($customer);
}

we need to restore the checkout session because the one-page success page controller validates the session then only its trigger checkout_onepage_controller_success_action  event. after then everything based on the checkout session.
if(!$_checkoutSession->isSessionExists()){
    $_checkoutSession->___init();
    $_checkoutSession->restoreQuote();
    echo "Order ID: " . $_checkoutSession->getLastRealOrderId();
}

So we need to restore the checkout session. Let me suggest how to do that.


texts: Wrong price in url while using price filter - Magento 2

texts: I'm using Magento layered navigation. While I'm trying to filter by price it's getting wrong value in the URL. Like I'm trying to filter from $2.00 to $4.99 but the URL got 2-5. What I want is either the URL to get $4.99 or the price range show round price like $5.00 instead of $4.99. Please see below image for better understanding. Any idea how can I do that?


texts: Magento 2 | Get product info from mysql query

texts:
I'm currently working on a Backend-like Page for special Customers within our shop. Theese special customers should be able to export product-data for a predefinied Shopsystem and other internal (shop related) stuff.

I was able to create a query with a thousands while statements but it looks pretty bad and is hard to understand / edit for someone with no understanding.

I road about MYSQL inner join statements and stuff like that but got never into it.

Has anyone a query to get the following data?

Product Name
Product SKU
Product Price
Short-description
Description
Main & Thumbnail image
Additional images
Product Categories

Or could explain / link ressources to get to a result like this ?

EDIT - 08/09/2017

I road a few documentaions and learned some new stuff. My query currently looks like this:

SELECT
    catalog_product_entity.entity_id AS id,
    catalog_product_entity.type_id AS type,
    catalog_product_entity.attribute_set_id AS attribute_id,
    catalog_product_entity.sku AS sku,
    catalog_product_entity_varchar.value AS name,
    catalog_product_entity_decimal.value AS price
FROM catalog_product_entity
    LEFT JOIN catalog_product_entity_varchar ON catalog_product_entity.entity_id = catalog_product_entity_varchar.entity_id
    LEFT JOIN catalog_product_entity_decimal ON catalog_product_entity.entity_id = catalog_product_entity_decimal.entity_id
WHERE
    catalog_product_entity_varchar.attribute_id = "71" AND
    catalog_product_entity_varchar.store_id = "0" AND
    catalog_product_entity_decimal.attribute_id = "75";

So far so good, everything works like i want it to be. The only part I dont understand ist the part where i have to select a new entry from catalog_product_entity_varchar to get the description and other attributes

Anything i can read about that ? Anyone who can help ?


texts:
Did any of you know a way to set a extra cost for a special country.
Like if customer is from sweden add + 40 USD.

So at the checkout summery:
Item Cost - 150 USD
Shipping Cost - 60 USD

+ Extra Cost for EU import - 40 USD

Thx


texts:
I'm using Magento 2.3.5 and I have a requirement where I need to disable caching of product prices (both in catalog view and product view pages).
I read the product prices from an external service and they change based on several conditions. What I'm looking for is to achieve this without breaking the full_page cache.
Thanks in advance !


texts: Magento 2 Custom Admin Action Redirected to Dashboard

texts:
I am taking the Magento 2 fundamentals development course and the Admin Router / Controller exercise seems out of date. The router does work, but the controller does not, it always just re-routes to the admin homepage. Code for router app/code/Training/Test/etc/adminhtml/routes.xml:

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

Code for Admin controller app/code/Training/Test/Controller/Adminhtml/Action/Index.php:

<?php

namespace Training\Test\Controller\Adminhtml\Action;
class Index extends \Magento\Backend\App\Action
{

public function execute()
    {
    die("test reached controller");
    }
protected function _isAllowed() {
    return true;
    }
}

When I go to the admin url of admin/test/action/index it just redirects and nothing happens. If I add a constructor and use xdebug, it shows that it reaches the controller constructor, but it never does the execute part. What am I missing?


texts: Got Error 500 when adding to cart Magento 1

texts:
I got 500 error when adding products to the shopping cart. I enabled the debug log and got the following error.  I thought it may be caused by affiliate extension. So I disabled the module. But I still got this error.

Anyone can help me with this bug? I really appreciate!


texts: How to add class to javascript document.write & shorten date format?

texts:
Delivery: FAST & FREE

How to add Class for each document.write('Between ')?

Output:

Delivery: FAST & FREE
Between Sun Mar 19 2017 06:35:17 GMT+0530 (India Standard Time) & Mon Mar 20 2017 06:35:17 GMT+0530 (India Standard Time)

Also how to shorten the date or change the date format to Between Sun Mar 19 & Mon Mar 20


texts: How to add Layered Navigation On Brand View Page

texts:
I'm using free Magento2.3 "Magetop_Brand" Ext. which is working fine but i want to call layered navigation on brand view page...how can i achieve?

Ext. URL:-

https://www.magetop.com/magento-2-shop-by-brand-extension.html

Thanks!!!


texts: Issue with EE 1.14, flat category and categories' url keys

texts:
I hope you can help me with this strange error.

Currently, we are working in a store with EE 1.14 and we are seeing a problem with category's url keys and url paths: They always return null. For example, if I execute the following:

$_cat   =   Mage::getModel('catalog/category')->load($_catId);
echo $_cat->getUrlKey() . '
';
echo $_cat->getUrlPath() . '
';

Both return me null. If I disable the Category Flat in the store, the error is fixed and both values are printed correctly. However, while it is enabled in the store, this persists.

I checked the table catalog_category_flat_store_1 and I noticed that, indeed, url_key and url_path fields have NULL value for all categories of the store. But in catalog_category_entity_url_key, url keys are stored correctly.

If I go to the backend, I'm going to a category, and manually save it, the url_key is stored and reflected in catalog_category_flat_store_1 correctly. However, if I run the reindexing:

php indexer.php --reindex catalog_product_flat

The url_key disappears again (ie, its value changes back to null).

It is noteworthy that only happens with the categories, not products. Do you know what could be causing this and how to fix it?

Greetings and thanks in advance for your support.


texts: How to filter product listing page based on discounts?

texts:
By default on listing page,

I want to show products whose offer is 15%.

$productCollection->addFieldToFilter(array('attribute'=>'offer','eq'=>'15'));

app\design\frontend\default\test\template\catalog\product\list.phtml

$_productCollection     = $this->getLoadedProductCollection()->addAttributeToFilter('offers', '15')->Clear()->addAttributeToSort('position', 'asc');

This I have done hardcode.


texts:
I would like to write a plugin for Magento\Customer\Controller\Account\LoginPost.

Actually I've custom template that is called when customer clicked on Proceed to Checkout. (Only when customer is not logged In)

That Template contains default login form.

After login there customer will redirect to checkout and will place order as guest.

Problem occurring when login failed at custom template. After failed login customer redirected to Core URL that is Customer/account/login that I don't want.

I want to redirect to my custom template when customer failed to login from my custom template.

  So Question Is How Can I prevent redirect to default form when login failed at my custom template ?

Note : Default login page functionality should be same no need to change into it.


texts: how to add tab content in seperate new tab in details page?

texts:
On my product details page I have three tabs, with the help of the following code:

    <?php if ($detailedInfoGroup = $this->getChildGroup('detailed_info', 'getChildHtml')):?>

            <?php foreach ($detailedInfoGroup as $alias => $html):?>
            <?php
                    if(trim($html)=="") continue;
            ?>

<?php echo $this->escapeHtml($this->getChildData($alias, 'title')) ?>

<?php echo $html ?>

            <?php endforeach;?>

    <?php endif; ?>

The tab contents are like:

Now I want to create a new and separate product-collateral tab near the above mentioned tabs.

When I use the below line in catalog.xml it is adding the tab content to the same tab.

<action method="addToParentGroup"><group>detailed_info</group></action>

I want to create a separate tab like the above one, not add to the existing one.

How can this be done?


texts: Automatically fill in grouped products / Client want "Kits" type of products

texts:
I have a client who wants a "kit" type of product. It would ideally look like a grouped product (that's why i want to use it), but the "kits" should be pre filled out in a way.

For example if you are selling a "Playstation 4 Starter Kit" with a Playstation 4 console, Playstation 4 handkontroll and let's NFL 2017 game.

But for example, if you click into this "kit" and you would like to add another controller, you would be able to edit the "1" to a "2". So it would pretty much be a grouped product with pre-filled values.

Any idea how it's possible to do this in Magento 1.9.x?


texts: Magento 1.9 redirect on checkout/cart after online payment

texts:
I've applied the latest security patches from the Magento website and after that, I have strange behaviour:

After an order is done with online payment (card) is redirecting to checkout/cart via public function successAction() from app\code\core\Mage\Checkout\controllers\OnepageController.php

This means that after the page is redirected to the payment website and then is back to our website, is loosing somehow session.

$session->getLastSuccessQuoteId() is returning NULL and because of that is doing this.

I've even check

$lastQuoteId = $session->getLastQuoteId();

$lastOrderId = $session->getLastOrderId();

$lastRecurringProfiles = $session->getLastRecurringProfileIds();

and those are null also. I've also looked to the DB and the quote is there and everything seems to be ok.

Can someone help me with this?


texts: Shopping cart quantity rule that changes catalog prices?

texts:
Does anyone know a way to create a shopping cart rule that will change the catalog prices?

Here is what we have setup. We have 5 levels of dealers, wholesale, Level 1, 2, 3, and 4. Each level gets a certain discount off wholesale depending on what level they are set at. Also each of these levels have quantity discounts.

Wholesale - 0-4 items - 0% Off
Level 1 - 5-9 items - 5% Off
Level 2 - 10-14 items - 10% off
Level 3 - 15-34 items - 12%
Level 4 - 35+ items - 14%

Like I said each dealer is set to a certain level(setup as customer groups in Magento), and I have catalog rules in place that show the discounted price in the catalog for each of these levels. The dealers also get any discounts above what they are set as if they hit the quantity levels.

For example, a level 2 dealer's catalog prices show the wholesale cost minus 10%($308.70) throughout the site and on the cart. If this dealer orders 15-34 racks they will receive the extra 2% off, and same goes if they hit 35+ items. I am able to apply shopping cart rules to adjust the prices for this and it applies the discount as a percent off as a discount on the cart.

This is fine and dandy is most cases but we use an automated software that pulls the orders from Magento and posts them to Quickbooks. So when this discount is applied and pushed to QB, the extra discounts show up as a single line item discount instead of changing the cost of the actually product.

Having a shopping cart rule that changes the catalog price would remedy this issue.

Thanks in advanced


texts: How can I get products details on CMS Page - Magento 1.9

texts:
I need to get products name and thumbnail images on cms page if customer enters sku, they get name, price, and thumbnail images.

Customer get short details using sku, if customer enter sku for given test box, they get short products details like Name, Price, Thumbnail. Is it Codeigniter worth?


texts: Search catalog with less than 3 characters

texts:
What is the solution to be able to search Magento 2 catalog with less than three characters.

This is what i have done so far from looking at Magento 1 info regarding this issue.

Setting "Max Query Lengt" in backend to 2
Changed the mysql setting ft_min_word_len=2 and restarted the server.
reindex and clear cache.

I have also tried to move the following indexing tables to MyISAM and then run a REPAIR QUICK on them and update the indexes

catalogsearch_fulltext_scope1
cms_block
cms_page
customer_grid_flat
sales_creditmemo_grid
sales_invoice_grid
sales_order_grid
sales_shipment_grid
catalogsearch_fulltext

The tricky thing with this is that bin/magento indexer:reindex changes them back to InnoBD. Don't know if they are dropped and recreated or how that happens but that's my result after a magento reindex.
The enginge change, repair, flushing and so on is done after magento reindex.

If anyone have an idea where to go from here i would be quite happy?

Thanks in advance
Thomas


texts: Number of products are not matching on category page

texts: I have 20 products in a category. But when I open the same category on frontend it shows 11 products. I logged the query and directly fired on the database, it correctly shows 20 records. But for the same query result is 11 on category page. What could be the reason.


texts: How create A-Z Product List Page in Magento 2?

texts: I need to create a page listing products alphabetically from A to Z and show only the products starting to each letter.


texts: Magento Custom Menu Admin not visible for User but visible for Administrators

texts:
I have a module that updates the amin menu by inserting a submenu called "Relatórios Personalizados" in the reports menu.

I set the role permissions for the user named "Luciano", however the menu is not visible to him.

But when I'm as admin, the menu is visible.

The role definition

The user definition

Logged as user

Logged as admin

My folder structure

In my controller

protected function _isAllowed()
{
    return true;
}

My adminhtml.xml

<?xml version="1.0" encoding="UTF-8"?>
<config>
    <menu>
    <report>
        <children>
            <customreport translate="title" module="vitali_customreport">
                <title>Relatorios Personalizados</title>
                <sort_order>5000</sort_order>
                <children>
                    <sales module="vitali_customreport" translate="title">
                        <title>Vendas</title>
                        <sort_order>1</sort_order>
                        <action>adminhtml/customreport/sales</action>
                    </sales>
                    <salesbyattrset module="vitali_customreport" translate="title">
                        <title>Vendas por Tipo de Produto</title>
                        <sort_order>1</sort_order>
                        <action>adminhtml/customreport/salesbyattrset</action>
                    </salesbyattrset>
                    <productsold module="vitali_customreport" translate="title">
                        <title>Produtos Comprados</title>
                        <sort_order>2</sort_order>
                        <action>adminhtml/customreport/productsold</action>
                    </productsold>
                    <treatment module="vitali_customreport" translate="title">
                        <title>Tempo de Tratamento</title>
                        <sort_order>3</sort_order>
                        <action>adminhtml/customreport/treatment</action>
                    </treatment>
                </children>
            </customreport>
        </children>
    </report>
</menu>
<acl>
    <resources>
        <admin>
            <children>
                <customreport translate="title" module="vitali_customreport">
                    <title>Relatórios Personalizados</title>
                    <sort_order>-100</sort_order>
                    <children>
                        <sales translate="title" module="vitali_customreport">
                            <title>Vendas</title>
                            <sort_order>1</sort_order>
                        </sales>
                        <salesbyattrset translate="title" module="vitali_customreport">
                            <title>Vendas por Tipo de Produto</title>
                            <sort_order>1</sort_order>
                        </salesbyattrset>
                        <productsold translate="title" module="vitali_customreport">
                            <title>Produtos Comprados</title>
                            <sort_order>2</sort_order>
                        </productsold>
                        <treatment translate="title" module="vitali_customreport">
                            <title>Tempo de Tratamento</title>
                            <sort_order>3</sort_order>
                        </treatment>
                    </children>
                </customreport>
            </children>
        </admin>
    </resources>
</acl>


texts:
In magento 2, how an order can be fulfiiled partially from Source1 and partially from Source2.
For example , I have 2 sources : SourceA having product with quantity 1 and SourceB having product with 3 , if I order product with quantity 2, it allows me to use SourceB only for fulfillment . Is there any way that order is fulfilled  from SourceA and remaining 1 quantity from Source B


texts: Redirect to external link from top links section

texts:
I using below method to redirect to an external link, but links are appended to Magento store URL.

i tried <prepare>false</prepare> and <prepare/> but same issue.

<action method="addLink" translate="label title">
        Track Your Order
        <url>https://www.indiapost.gov.in/VAS/Pages/trackconsignment.aspx/</url>
        <title>Track Order</title>
       <prepare>false</prepare><urlParams/>
        <position>100</position>
        <liParams/>
       <aParams><![CDATA[target="_blank"]]></aParams>
        <beforeText></beforeText>
        <afterText></afterText>
    </action>

UPDATE: I tried this also but same issue .

<action method="addLink" translate="label title">
        Track Your Order
        <url>www.indiapost.gov.in/VAS/Pages/trackconsignment.aspx/</url>
        <title>Track Order</title>
       <prepare/><urlParams/>
        <position>100</position>
        <liParams/>
       <aParams><![CDATA[target="_blank"]]></aParams>
        <beforeText></beforeText>
        <afterText></afterText>
    </action>

I am getting this url http://websitename.in/www.indiapost.gov.in/VAS/Pages/trackconsignment.aspx/


texts: Magento 2 plugin not calling the around function

texts:
I created a small module which has a plugin.
This plugin must exchange a method with my own.

But my plugin is never being called.

I have been staring at this for a few hours. Can anyone help me with this?

/etc/di.xml:

<?xml version="1.0" ?>
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:ObjectManager/etc/config.xsd">
    <type name="Magento\CatalogSearch\Model\Indexer\Fulltext\Action\DataProvider">
        <plugin disabled="false"
                name="Custom_ConfigurableChildSearch_DataProvider"
                sortOrder="10"
                type="Custom\ConfigurableChildSearch\Plugin\DataProvider"/>
    </type>
</config>

/Plugin/DataProvider.php:

<?php

namespace Custom\ConfigurableChildSearch\Plugin;

class DataProvider
{
    /**
     * @param \Magento\CatalogSearch\Model\Indexer\Fulltext\Action\DataProvider $subject
     * @param \Closure                                                          $proceed
     *
     * @param                                                                   $indexData
     * @param                                                                   $productData
     * @param                                                                   $storeId
     */
    public function aroundPrepareProductIndex(\Magento\CatalogSearch\Model\Indexer\Fulltext\Action\DataProvider $subject, \Closure $proceed, $indexData, $productData, $storeId)
    {
        var_dump('test');
        exit;

    }
}


texts: MySQL/PerconaDB & Apache/LiteSpeed Optimizations for Magento

texts:
I know it's very vague but this is more of a general question than anything as I cannot find a solid answer to my question.

I just deployed a new dedicated server and had the hosting management install Percona as well as LiteSpeed. The questions are:

I see a lot of Apache optimizations as far as Magento is concerned but since I installed LSWS Enterprise does the optimization configuration tips apply to LSWS as well? Should I do those that applies to my server environment?
Like question 1 - I had them install PerconaDB as well and I know there are a lot of MySQL tuning for Magento. Do those vanilla MySQL tweaks apply to PerconaDB as well? Or does PerconaDB has it's own configuration file that I should look in to?

Not sure if it matters but here's my server specs:
Xeon 4C/8T E3-1240V3
32GB RAM
120 GB Intel SSD
1TB HDD
1Gbps Uplink Speed


texts:
I want to edit the footer section in entire site. How can I do that. Further when we go to store-> configuration -> design from admin panel we can edit the design.
Where is it going to apply as I cannot see the changes I have done through that.


texts: One repository for multiple composer.json file

texts:
I want to use a main repository and to have a module that I will require through composer.
Since I'm playing some integration tests and processing some pipelines such as phpmd checks, for the main repository of the module I need all environment files like this :
...
├── app
│   └── code
│       └── *.php
│       └── composer.json // `name/module`
│
|- phpmd.xml
|- dev/tests/integration
│- composer.json  //`name/project`
...

When I'm using this module as a package, I would like to do something like composer require name/module only because I need whats in app/code when requiring the module (this is what composes the module)
Magento is doing something like that here but I can't achieve to do the same thing :
https://github.com/magento/magento2/blob/2.4-develop/app/code/Magento/AdminAnalytics/composer.json#L2
https://github.com/magento/magento2/blob/2.4-develop/composer.json#L108
Is it possible to achieve such thing with composer? If its possible, how can I do that?
Thanks you!


texts: Webshopapps Premium Matrix Rates - php7.1 compatibility

texts:
Webshopapps has deprecated their much used matrix rate modules, so they won't support PHP7.1+, which means a lot of people cannot upgrade php to a secure version.

The issues are fx. the use of pushing strings to arrays shorthand ([]).

&$itemGroup = array()
$itemGroup[] = $item;

How do i fix these type of compability issues?


texts: Magento2: Is it possible to get a reference to containers and programmatically add blocks to them?

texts:
$block = $this->getLayout()
        ->createBlock('Magento\Framework\View\Element\Template')
        ->setTemplate('MyModule_ProductTile::widget\test.phtml');

 $this->getLayout()->getBlock('content')->append($block);

$this->getLayout()->getBlock('content') returns false, I found a suggestion to use $this->loadLayout() but I get an invalid error function


texts: Recalculate Price Filter when using an observer to change prices

texts:
I'm using an observer to change the price of some products for the list view using setFinalPrice().

However, this does not update the price filter in the layered navigation.

Any ideas how I would update this? I've checked documentation and tried searching for similar issues, but haven't found anything.


texts: Magento 1:9 : Move order button from review div in onestepcheckout

texts:
I have recently moved to LotusBreath OneStepCheckout. I made a few alterations to the extension.

As soon as I moved the complete order button from the review div into another div, I was able to place multiple orders by clicking the button twice.

Does anyone know how you can move the button without affecting functionality?


texts: How to add quantity increment and decrement on category listing page and product page in magento

texts: I want to add quantity increment and decrements on category listing page and product detail page in magento 1.9


texts:
I'm uploading product images to s3 bucket and I need to import products from csv.

So I set Images File Directory to be https://s3.eu-west-2.amazonaws.com/image-folders/, But I got hat error

1. Imported resource (image) could not be downloaded from external resource due to timeout or access permissions in row(s): 1, 2, 3, 4, 5, 6


texts: Magento tries to load many ressource files from server root

texts:
I created a dump of our live database and imported it to my test environment.

My project is in /srv/www/vhosts/example. it tries to load js/mage/cookies.js from http://example.com/srv/www/vhosts/blizz/js/mage/cookies.js instead of from http://example.com/js/mage/cookies.js

I checked my base urls and cookie domain, this is the output of my ./n98-magerun.phar sys:check:

✔ Secure BaseURL: http://example.com/ of Store: example_v18 - OK
✔ Secure BaseURL: http://example.gala/ of Store: example_gala_v18 - OK
✔ Secure BaseURL: http://example.ch/ of Store: example_ch - OK
✔ Unsecure BaseURL: http://example.com/ of Store: example_v18- OK
✔ Unsecure BaseURL: http://example.gala/ of Store: example_gala_v18 - OK
✔ Unsecure BaseURL: http://example.ch/ of Store: example_ch - OK
✔ Cookie Domain (secure): example.com of Store: example_v18 - OK
✔ Empty cookie Domain (secure) of Store: example_gala_v18 - OK
✔ Empty cookie Domain (secure) of Store: example_ch  - OK
✔ Cookie Domain (unsecure): example.com of Store: example_v18 - OK
✔ Empty cookie Domain (unsecure) of Store: example_gala_v18 - OK
✔ Empty cookie Domain (unsecure) of Store: example_ch - OK


texts: Is there a plugin for applying discounts on certain bank credit cards in magento?

texts: I would like to know if there is a plugin for applying discounts on the sub total when a certain bank credit card is being used for transaction. I am planning to connect different banks to my webstore. When a customer is purchasing a product, he/she can enter their valid credit card of the specified bank to check if they can use the discount on the sub total.


texts: Auto generated codes showing as expired , before set expiry date

texts:
We have auto generated codes that last 3 days they are very simple coupon rules i.e 10% discount off all orders or free postage.

Once the code is generated if a customer tries to use them it will sometimes say that the code has already expired. I have checked and the code is still valid. This doesn't happen with all of the vouchers that are generated but I cannot see a pattern.

Any help?


texts:
I am facing a situation & not much clear as it is default Magento's way of working or something !

Say I have created a shopping cart rule ( discount Promo Code) which get expire on 25-Dec-2015 and suppose a customer apply the code and abandon the order ( ie added to cart and applied the discount code but placed the order ) . Now the same guy comes after "25-Dec-2015" and checkout the order from his cart ( in which Discount code was applied), in this case should not be applied Discount Coupon should expire ??


texts:
I am using Magento 1.9 version to my Ecommerce site In that i am setting secure url (https://) in all page is it good practice or it have any drawbacks for that can you please guide me

my all page url should be https://domain.com.  But I didn't use https://www.domain.com

Can you please suggest me


texts: browse files button doesn't work when i click

texts:
I am having a problem with the browse files button not working when clicked.  I don't know why, adobe flash plugin is working fine, I am using magento 1.9

thank you


texts:
I have uploaded some thousands of product with 1 to 5 images each, so a consistent amount of images after all. After the upload I reviewed all the images one by one and they were ok.

Now, one week has elapsed and randomly some products have lost the image associated: on the frontend, I see the placeholder, and on the backend I see a white image with a red cross in the upper left corner. This happens on around one tenth of all products, so I can't see how this can be caused by permission issues at all.

Refreshing the images cache didn't help. The only way to fix the problem is to reload the images of the corrupted products.

Here is the html image code in the frontend:

And here is the code in the backend:

This is a non-existing path (folder 7 is missing).


texts: Magento2 : Not getting proper http referrer url

texts:
This code is not displaying the referrer URL of the website from which the user has come to the current page. Instead, it is displaying the website base URL any idea why it is happening?
It is working fine on my website. when the user moves from product to contact page etc.
I also tried this too.

echo $_SERVER['HTTP_REFERER'];

but not working.

Here is my current code

 $objectManager = \Magento\Framework\App\ObjectManager::getInstance();
            $redirect = $objectManager->create('\Magento\Framework\App\Response\RedirectInterface');
             echo $redirect->getRefererUrl();

  Output: http://www.yourwebsite.com/

Expected Result: http://www.previouswebsite.com/


texts: Magento 2 Add to cart out of stock item issue

texts:
I have a product with 0 quantity and Out of Stock Product, and it is showing on front-end. Customer is able to do add that product to cart.

I run all commands like:

php bin/magento indexer:reindex
php bin/magento cache:flush
php bin/magento cache:clean

but issue not solved.

Please tell me the appropriate solution.


texts: How to add global container fo all my actions using layout block magento2

texts:
i want to add a global select like 'Select one option' contains my all actions 'Renew' and 'View' ,
can anyone tell me how to do that ?

This is my code for now I have done some effort but 'Select one option' still not showing?

$this->addColumn(
                'action',
                [
                    'header' => 'Action',
                    'filter' => false,
                    'sortable' => false,
                    'width' => '100px',
                    'renderer' => \Magento\Sales\Block\Adminhtml\Reorder\Renderer\Action::class
                ]
            );

public function render(\Magento\Framework\DataObject $row)
    {
        $this->_actions = [];
        if ($this->_salesReorder->canReorder($row->getId())) {
            $tbltofill = [];
            $reorderAction = [
                'view' => [
                    'href' => $this->getUrl('sales/order/view', ['order_id' => $row->getId()]),
                    'label' => __('View'),
                ],
                'renew' => [
                    'href' => $this->getUrl('sales/order_create/reorder', ['order_id' => $row->getId()]),
                    'label' => __('Renew'),
                ]
            ];
            $tbltofill['Select one option'] = $reorderAction;
            $this->addToActions($tbltofill);
        }
        $this->_eventManager->dispatch(
            'adminhtml_customer_orders_add_action_renderer',
            ['renderer' => $this, 'row' => $row]
        );
        return $this->_actionsToHtml();
    }


texts: "Place Order" button on checkout page not working - Magento 2

texts:
When I click on "Order Now" on the checkout page nothing happens. This is both for the Third party One Step Checkout and the generic Magento One Step Checkout.

Not sure what could be causing this.

Please could you kindly advise.

Thanks.


texts: Editing the list of JSs loaded in the cart page

texts:
When I visit my cart page, there are several ajax call in background which are fetching data which are not used in that page.

Is there a way I can revisit the list of JSs loaded only in the cart page?


texts: video Not found while add youtube video in magento 2

texts:
I need to add  product video in magento 2, so, i get youtube api key  add to

Stores > Settings > Configuration-> Catalog -> Product Videos  and enter the youtube api key.  and Save Config

then, clear the cache

then go to
 Admin palnel -> Catalog -> Product Detail -> Add Video then enter the  Youtube URL key, then show

  Attention

  Error: "Video not found"

But, play this video in online. and suggest how to fix this issue.

Note: suggest this also, how to import  product local videos(pub/media/videos)  in magento 2.


texts:
For Magento 1 there is an informative report about the import performance in  https://www.integer-net.de/produktimport-mit-magento/

For Magento 2 and a shop project with < 10 k simple products we successfully used

/*
* @var \Magento\ImportExport\Model\Import $import
*/
$import->validateSource($csvSource);
$import->importSource()

see
Function for Import catalog products.

But for 300 k products we see a really poor performance for this approach.

Are there any tweaks that allow us to reach the 100 products/seconds or more that the ImportExport of Magento 1 delivered?


texts: Magento - Can't connect to Mysql server error frequently

texts:
We have a dedicated server with a virtual instance running the application server with Apache, PHP and a virtual instance with DB on it. We are running Magento 1.7.0 version on the application server and MySql as the DB. For some reason the site appears to go down atleast 3-4 times a day.

During the time Magento is down with an error of "Can't connect to Mysql server", Apache seems ok, with it not being overloaded. The mysql server also seems to be in good health with no overloading and not many procesess. If you try to connect from the Magento instance to the DB server via the mysql command it takes a while for the command to be executed. We have checked all the network parameters and all seem fine.

Kindly let me know if you have any suggestions.


texts: Order status out of sync between sales_flat_order and sales_flat_order_grid

texts:
I've a handful of orders (3 out of about 16,000) where the order status shown in the sales_flat_order table differsfrom that in thesales_flat_order_grid table`.

The three orders have the processing status in the sales_flat_order_grid table, but closed, on hold and complete in the sales_flat_order table.

I'd like to tidy this up. Is there an automatic method which will push the true state of the order contained in sales_flat_order into sales_flat_order_grid. Failing that is it safe, sensible to modify the database directly, adjusting the status of these orders in the sales_flat_order_grid table?


texts: Adding custom options to all products of a certain type on save

texts:
I have created some custom product types that extend from simple products. These product types will all have the same custom options added, so I'd like to just set those options on the product when saved as well as removing any other options that might have been added accidentally.

In my product type model, I have added the following save() method:

//My_Module_Model_Product_Type_Customtype extends Mage_Catalog_Model_Product_Type_Simple

public function save($product = null)
{
    $option = array(
        'title' => 'My Options',
        'type' => 'field',
        'is_require' => 0,
        'price' => 5,
        'price_type' => 'fixed',
        'sku' => 'mysku'
    );

    $product->setCanSaveCustomOptions(true);
    $optionInstance = $product->getOptionInstance();
    $optionInstance->unsetOptions();
    $optionInstance->addOption($option);
    $product->setHasOptions(1);
    $optionInstance->setProduct($product);

    return $this;
}

When I load an existing product of my type that does not have custom options assigned, the option I am adding inside save() can not be seen after the product saves; however, if I add a custom option from the admin form and then save, my option added in save() does get added. It seems the option will only get saved if the product already has a custom option assigned through the admin

I am guessing I am missing something basic, but can't seem to find what it is.

EDIT

I took a look at the catalog_product_option table, and the option I add in save() is listed here, but it doesn't appear on the product's custom options tab unless I add an additional option manually from admin.

EDIT 2

It seems that $product->setHasOptions() isn't working. When I look at catalog_product_entity, that value is 0. Manually changing it to 1 resolves the issue.

How am I supposed to save custom product type data while in the save() method?


texts: How can i override the PriceCurrencyInterface in Magento 2?

texts:
In \magento\framework\Pricing\PriceCurrencyInterface, I want to change the constant in that php interface file from this:

/**
 * Default precision
 */
const DEFAULT_PRECISION = 2;

to this:

/**
 * Default precision
 */
const DEFAULT_PRECISION = 0;

What is the best practices to override this php interface from the magento core files?


texts: Add custom column to grid that can be exported

texts:
I want to add a column to sales order invoice grid, that should be exported as it is shown in the grid.The column is a calculated column, based on the row data, so there is no explicit database entry for the column value.

Those questions already had similar issues: Magento 2 + Custom column added sku on grid not showing data in export file and Magento 2 Add Custom Sale Order Grid Column and Export in CSV.

But the answers to those question either suggest to alter ConvertToCsv.php and ConvertToXml.php or are based on a database entry that is joined.

Altering one of the ConvertToXXX.php files in IMHO not the right way, since the generation and calculation of the column data has nothing to do with either csv or xml. Nor do I have da database entry, so the answer does not hold.

Currently I got the following solution, which shows the data in the grid but does not get exported:

File {vendor}\{module}\view\adminhtml\ui_component\sales_order_invoice_grid.xml

with content:

<?xml version="1.0" encoding="UTF-8"?>
<listing xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Ui:etc/ui_configuration.xsd">
    <columns name="sales_order_invoice_columns">
        <column name="custom_column" class="{vendor}\{module}\Ui\Component\Listing\Column\CustomColumn">
            <argument name="data" xsi:type="array">
                <item name="config" xsi:type="array">
                    <item name="visible" xsi:type="boolean">true</item>
                    <item name="label" xsi:type="string" translate="true">Custom Column</item>
                </item>
            </argument>
        </column>
    </columns>
</listing>

and {vendor}\{module}\Ui\Component\Listing\Column\CustomColumn.php with content:

class CustomColumn extends Column
{
    protected $orderRepository;

    public function __construct(...)
    {
        ...
    }

    public function prepareDataSource(array $dataSource)
    {
        if (isset($dataSource['data']['items'])) {

            foreach ($dataSource['data']['items'] as & $item) {

                $order  = $this->orderRepository->get($item["order_id"]);
                // $value = calculate value based on order data
                $item[$this->getData('name')] = $value;
            }
        }

        return $dataSource;
    }
}

This is a perfectly fine and easy solution, it respects the Single Responsibility Principle and the Open Closed Principle. I can add multiple additional columns by just adding code, without modifying code. Drawback: The calculated value does not get exported.

In Magento core code in vendor/magento/module-sales/Ui/Component/DataProvider/Document.php they use a switch-case statement to alter some database values to export values. First, I don't know how to intercept/extend this behavior, and secondly, I don't like that switch-case statement, which does not quite adhere to the OCP.

So what is the recommended or best way to show data in the grid and get it exported (independent on which export format was chosen), in best case without doing it twice for grid and export separately.


texts: How to add mutiple extra tabs on product page Magento 2

texts:
I want to display multiple tabs(inconstant number) on product page, with the code below by using layout(catalog_product_view) i am only able to add fixed amount of tabs.

<?xml version="1.0"?>
<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd">
<body>
    <referenceBlock name="product.info.details">
        <block class="AbdusSalam\AddTab\Block\ProductTabs" name="extratab"  template="AbdusSalam_AddTab::product_tabs.phtml" group="detailed_info">
           <arguments>
               <argument name="title" xsi:type="string">Extra Tab</argument>
           </arguments>
        </block>
    </referenceBlock>
</body>


texts: fme layered navigation Undefined variable: html

texts:
i have a problem with fme layered navigation with the following errors i don't how this happened  any body could help me please ?

  Notice: Undefined variable: html  in
  /var/www/html/app/code/local/FME/Layerednav/Block/Rewrite/RewriteCatalogCategoryView.php
  on line 18

https://znbaq.com/for-her/women-clothes/women-dress.html


texts:
I've made a custom header and add some custom blocks there but now the mobile header and toggle navigation does not appear at the breakpoints, only my desktop header.
Have i overridden it by customising the header? How do I make my custom header only visible in desktop view and to inherit luma's mobile menu in that view?


texts: Magento 2 backend configuration field with custom source model not working

texts:
I am trying to add a new configuration field to my module's configuration page that uses a custom source_model, as soon as I add the field to system.xml the whole configuration section goes blank. If I take out the field, the section works fine and shows other fields as expected.

//file app/code/TahirYasin/Hello/etc/adminhtml/system.xml

...
                <field id="custom_select"
                    translate="label"
                    type="select"
                    sortOrder="2"
                    showInDefault="1"
                    showInWebsite="1"
                    showInStore="1">
                    <label>Scope</label>
                    <source_model>TahirYasin\Hello\Model\Config\Source\Custom</source_model>
                </field>
...

my new source model

//file app/code/TahirYasin/Hello/Model/Config/Source/Custom.php

<?php

namespace TahirYasin\Hello\Model\Config\Source;

class Custom implements \Magento\Framework\Option\ArrayInterface
{
    /**
     * Return array of options as value-label pairs, eg. value => label
     *
     * @return array
     */
    public function toOptionArray()
    {
        return [
            'value' => 'Label',
            'another_value' => 'Another value',
        ];
    }
}

What am I doing wrong here? Any help plz


texts: Disabling the Magento Core Module CatalogInventory

texts:
Scenario:

We have a store that sells virtual products that basically never go out of stock.
While we profiled the queries running on the category landing page we found that there a number of queries that deal with inventory.

E.g SELECT mag_cataloginventory_stock_status.product_id, mag_cataloginventory_stock_status.stock_status FROM mag_cataloginventory_stock_status WHERE (product_id IN('5665', '5664', '5663', '5662', '5661', '5660', '5659', '5658', '5657', '5655', '5654', '5653', '5652', '5651', '5650', '5649', '5648', '5647', '5646', '5645', '5644', '5643', '5642', '5641', '5639', '5638', '5636', '5635', '5634', '5633', '5630', '5629', '5628', '5626', '5625', '5623',.. And so on)) AND (stock_id=1) AND (website_id=1)
As we really do not have any concept of Stock (we have another flag to avoid display of the product) I wanted to simply git rid of any overhead this adds.

Question:

Is it possible to disable the core module Mage_CatalogInventory, I did try this and it threw a Fatal error saying Mage_Checkout depends on this.
Is there a graceful way to simply disable this module ?


texts: How to HyperLink block_name on any block or Product Slider Name Title

texts:
When using the code below, it shows feature product slider on any CMS page with the title that is a value of the block_name attribute.

It's shown as a plain text, but I want to make it a hyperlink.

In other words, how to make the title of a slider block into a link, which is clickable?

{{block type="ultimo/product_list_featured"
template="catalog/product/list_featured_slider.phtml"
timeout="4000" loop="1" category_id="655" product_count="12"
hide_button="1" timeout="16000" is_random="1"  block_name="Clearance Sale"}}


texts: Magento 2 store locator extension to use custom table data

texts:
We are looking to implement store locator and came across Amasty and other store locator extensions. Those extensions appear to be creating custom tables during install and give admin panel pages to create, update, and maintain existing and new stores.
We are looking for is a store locator extension/module, that can work with existing DB table(s) data, without minimal code changes and/or configuration, to avoid changing other processes that rely on existing DB schema/tables. Let me know if there are any paid or open source extensions that allow this kind of flexibility.

The existing table has lot of columns that are used during custom checkout process, would not like to change that flow to limit testing and development effort for the store locator pages alone.

Thanks


texts: How to add remove from cart button onto category page

texts:
I am currently developing Magento 1.9 (yes I know it's outdated) and they have requested remove from cart buttons on the category page (list.phtml), however, I cannot seem to find a way to add the button.

I have successfully added the button to the page, but can't seem to get the actual like to be correct with the correct data, I believe this to be because I cannot match the quote id to the product id correctly, however it also seems that this gives a much shorter form key than what is normally used by Magento.

$productid = $_product->getId();
<a href="<?php echo $this->getUrl('checkout/cart/delete', array('id' => $productid, Mage_Core_Model_Url::FORM_KEY => $this->_getSingletonModel('core/session')->getFormKey())); ?>">X

Any help would be much appreciated


texts: How to set magento/product downloadable-links via REST API

texts:
I tried to set downloadable-links for on product create and tried on product update the product but didn't work.

I tried this end Point it

POST "/v1/products/$sku/downloadable-links"

like this

$downloadable_product_links = [
                [
                'id' => 1
                , 'title' => json_encode(["resolution" => "1000x2000 px", "dpi" => "72", "size" => "16 KB"])
                , 'sort_order' => 1
                , 'is_shareable' => 1
                , 'price' => 15
                , 'link_type' => 'url'
                , 'link' => 'https://my-domain/image/DSC_0801.JPG'
                , 'link_url' => 'https://my-domain/image/DSC_0801.JPG'
            ],
                [
                    'id' => 2
                    , 'title' => json_encode(["resolution" => "150x200 px", "dpi" => "72", "size" => "18 KB"])
                    , 'sort_order' => 2
                    , 'is_shareable' => 1
                    , 'price' => 14
                    , 'link_type' => 'url'
                    , 'link' => 'https://my-domain/image/DSC_0801.JPG'
                    , 'link_url' => 'https://my-domain/image/DSC_0801.JPG'
            ]
        ];
        $result = MagentoConn::instance()->reqPOST("/products/$sku/downloadable-links", $downloadable_product_links );

it gives me this error message

object(stdClass)[163]
  public 'message' => string '%fieldName is a required field.' (length=31)
  public 'parameters' =>
    object(stdClass)[164]
      public 'fieldName' => string 'link'

where this link field should be and what it should hold?Iried to put it  as a key for the above array but is gave an Exception "no setter"


texts: Magento 2 code to get Magento 1 product detail via rest api

texts:
I would like to use Magento 1 rest api to get the product details in Magento 2.

Can anybody help me out on magento 2 code for getting the product details from magento 1.
http://devdocs.magento.com/guides/m1x/api/rest/introduction.html


texts: Magento not loading CSS and Javascript in Centos 7

texts:
pretty sure this has to do with rewrite module, but i don't know enough about how .htacess and httpd to figure this out, after trying for hours.  Had the same issue with WAMP and enabling rewrite module solved this there.

this is my httpd.conf (/etc/httpd/conf/)

    Options Indexes FollowSymLinks MultiViews
    AllowOverride All
    # Allow open access:
    Require all granted

Options Indexes FollowSymLinks MultiViews
AllowOverride All
Require all granted

LoadModule rewrite_module modules/mod_rewrite.so

My .htaccess file has the following

enable rewrites

Options +FollowSymLinks
RewriteEngine on

File permissions set to 755; under my sql database (core_config_data) secure and unsecure base url set to http://127.0.0.1, web/url/redirect set to 0.

Anyone have any idea what could be wrong here? when I load the page all i get is text, no css or javascript, any help would be greatly appreciated, just can't figure this out.


texts:
We are using Marketplace extension in my site, so seller also can process there own order.

i add custom order status i need to generate shipping slip after change that status

 public function shipmentorderAction(){
                $id = $this->getRequest()->getParam('id');

                $order = Mage::getModel('sales/order')->load($id);

                if($order->canShip())
{
    echo "check";
    exit();
$itemQty =  $order->getItemsCollection()->count();
    $shipment = Mage::getModel('sales/service_order', $order)->prepareShipment($itemQty);
    $shipment = new Mage_Sales_Model_Order_Shipment_Api();
    $shipmentId = $shipment->create($id);

}
                $order->setData('state', 'Shipment');
                $order->setStatus('Shipment');
                $history = $order->addStatusHistoryComment('', false);
                $history->setIsCustomerNotified(false);
                $order->save();

                $order->sendOrderUpdateEmail(true, null);

                $this->_getSession()->addSuccess(
                    $this->__('This Order has been Shipped Successfully')
                );
                //$this->_redirect('mpshippingmanager/shipping/index');
                Mage::getSingleton('core/session') ->addSuccess('Order Updated Successfully'); $this->_redirectReferer();

                }


texts: Magento 2 Unit Test error: Call to a member function getBaseUrl() on null

texts:
I am looking to write basic unit tests for some helper functions that I am working on for a Magento 2 module. I am able to execute my custom module unit tests but I am getting the following error for the first test.

When I execute the tests for my module I get the following error:

  Call to a member function getBaseUrl() on null

My Helper code is below: I will be adding quite a few functions to it later and the function its self returns the correct result if I call it else where in my code, I am not able to get the test working.

namespace MyModuleSpace\MyModule\Helper;

use Magento\Framework\App\Helper\Context;
use Magento\Store\Model\StoreManagerInterface;

class Data extends \Magento\Framework\App\Helper\AbstractHelper {

    /**
     * Attribute to hold storeManager Object
     *
     * @var object
     */
    protected  $storeManager;

    /**
     * _construct
     *
     * @param Context $context
     * @param StoreManagerInterface $storeManager
     */
    public function __construct(Context $context, StoreManagerInterface $storeManager) {
        $this->storeManager = $storeManager;
        parent::__construct($context);
    }

    /**
     * No params needed. Returns base site URL.
     *
     * @return string
     */
    public function getBaseURL() {
        return $this->storeManager->getStore()->getBaseUrl();
    }

}

My Unit Test code is

namespace MyModuleSpace\MyModule\Test\Unit\Helper;

//class HelperTest extends \PHPUnit_Framework_TestCase { // not usable as it is not supported
class HelperTest extends \PHPUnit\Framework\TestCase {

    protected $helper;

    /**
     * Sets up the Mock (reflection) objects and properties for tests...
     *
     */
    protected function setUp() {

        $objectManager = new \Magento\Framework\TestFramework\Unit\Helper\ObjectManager($this);
        $this->helper = $objectManager->getObject('MyModuleSpace\MyModule\Helper\Data');

    }

    /**
     * Run unit tests for getBaseURL()
     */
    public function testGetBaseURL() {

        $baseUrl = $this->helper->getBaseUrl();

        // Test we are returning a string...
        $this->assertTrue(is_string($baseUrl));

    }

}

I am not sure what I am doing wrong but any help would be appreciated.


texts:
I am just learning Magento from the book Magento for PHP Devs but when I tried to recreate this code I got an error: PHP warning:  include(Mage/Mdg/Giftregistry/Model/Entity.php): failed to open stream: No such file or directory in /var/www/html/learn/lib/Varien/Autoload.php on line 94

Due I have no experience I require some help. I have flushed Cache several times and still don't get it right. This is some data.

The error happens when I try to create a new model:
$registry = Mage::getModel('mdg_giftregistry/entity');

ERROR: PHP warning:  include(Mage/Mdg/Giftregistry/Model/Entity.php): failed to open stream: No such file or directory in /var/www/html/learn/lib/Varien/Autoload.php on line 94

Im using magerun netz98. Maybe this has something to do?

My files:

app/etc/modules/Mdg_Giftregistry.xml

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

app/code/local/Mdg/Giftregistry/etc/config.xml:

    <?xml version="1.0"?>
<config>
    <modules>
        <Mdg_Giftregistry>
            <version>0.2.0</version>
        </Mdg_Giftregistry>
    </modules>
    <global>
        <models>
            <mdg_giftregistry>
                <class>Mdg_Giftregistry_Model</class>
            </mdg_giftregistry>
        </models>
        <blocks>
            <mdg_giftregistry>
                <class>Mdg_Giftregistry_Block</class>
            </mdg_giftregistry>
        </blocks>
        <helpers>
            <mdg_giftregistry>
                <class>Mdg_Giftregistry_Helper</class>
            </mdg_giftregistry>
        </helpers>
        <resources>
            <mdg_giftregistry_setup>
                <setup>
                    <module>Mdg_Giftregistry</module>
                </setup>
            </mdg_giftregistry_setup>
        </resources>
    </global>
</config>

app/code/local/Mdg/Giftregistry/Model/Entity.php :

    <?php
    class Mdg_Giftregistry_Model_Entity extends Mage_Core_Model_Abstract {
      public function __construct() {
      $this->_init('mdg_giftregistry/entity');
      parent::_construct();
     }
    }

Any suggestion?