texts:
I am trying to write orders. But something is wrong there. Unfortunately I don't know what because

    $transaction->addObject($order);
    $transaction->addCommitCallback(array($order, 'place'));
    $transaction->addCommitCallback(array($order, 'save'));
    try {
      $transaction->save();
    } catch(Exception $e) {
      Mage::log($e);
    }

in that code the $transaction-save() is not logging any error. When I reach $transaction->save(); the script stops and all next steps are not getting called. I want that this error is getting logged somewhere, so that I know what I did wrong.


texts: 1.9 - Add custom image upload to CMS Page - Won't save

texts:
I have an observer here:

app/code/local/LCMS/CMS/Model/Observer.php

Which contains the following:

class LCMS_CMS_Model_Observer
{
    public function cmsField($observer)
    {

        $model = Mage::registry('cms_page');

        $form = $observer->getForm();
        $form->setEnctype("multipart/form-data");

        $fieldset = $form->addFieldset('lcms_author_fieldset', array('legend'=>Mage::helper('cms')->__('Additional'),'class'=>'fieldset-wide'));

        $fieldset->addField('ogimg', 'image', array(
          'name'      => 'ogimg',
          'label'     => Mage::helper('cms')->__('OG Image'),
          'title'     => Mage::helper('cms')->__('OG Image'),
          'disabled'  => false,
          'value'    => $model->getogimg()
        ));

    }
}

This gives me an 'additional' section on the CMS Page admin, with a file select:

It allows me to select a file, however it doesn't actually save it.

How can I get this file to upload/save?


texts: How to render widgets in product and category description in Magento 2?

texts:
In Magento 2 we can add widgets to CMS pages and CMS blocks with a directive like this (assuming we created this custom widget with a module before):

{{widget type="Vendor\Module\Block\Widget\CustomWidget" some_addtribute="some-value"}}

When we add the same widget code in product or category description it is not rendered. So the output is the text string from above.

How can we extend Magento 2 in a way that it will render widgets in product or category descriptions as well?


texts: How can I check if a product exists in Magento 2 without throwing \Magento\Framework\Exception\NoSuchEntityException?

texts:
I'm attempting to scan an incoming list of products and add any new ones to the catalog.  Therefore, I must run a check on each product to see if it already exists.

I'm using a ProductRepositoryInterface via DI to load each product by SKU, but if the product doesn't exist within the catalog (new product), it fails with a \Magento\Framework\Exception\NoSuchEntityException.

How can I write logic around this so I can either: confirm the product exists, skip it gracefully, and move on OR confirm the product doesn't exist, and then add it?  Is there something like an exists() method that I'm missing?

$product = $this->productRepository->get($xmlProductSku);


texts:
i am working on magento category. my requirement is if request path already exist than no need to add second time.

also if request path exist than no need to add that path second time in url rewrite and also should not generate url containing random number for category url.

i have found it in Mage_Catalog_Model_Url but unable to find how to stop.


texts: Magento setting to remove Google indexed urls that had parameters

texts:
I have been setting up a new magento site for a client and while I was still learning my way around Magento (only new to it) Google managed to index the entire site and has indexed +7000 entries for a site with like 46 pages in its sitemap.

Looking further at it, the majority has been the individual combinations of parameters available for each of the pages.

And I also tidied up the urls for SEO by removing the .html at the end (but the .html versions got indexed too and now have 404's)

I have the correct robots.txt in place to block such a thing happening.

The problem now is because google bet me to it, I have thousands of indexed pages with 404 errors.

Some reading up suggests that using the robots.txt to block them won't remove those that exist on there already, so I was wondering if anyone knew a magento specific way I could update those urls to NOINDEX rather than having to delete them from the index one at a time.

I was thinking maybe allow those pages through the robots.txt but use .htaccess to update all the links with certain parameters to be NOINDEX so google removes them from the index then once removed, block them again in the robots.txt, but am not too sure on what solution would be best...

Any ideas?


texts: How to get ScopeConfigInterface through the object manager of unit tests in magento 2?

texts:
I'm trying to read a row in my unit test from core_config_table in magento 2 database. I know that to accomplish this job as I have read  this link. I have to use:

\Magento\Framework\App\Config\ScopeConfigInterface

through:

\Magento\Framework\TestFramework\Unit\Helper\ObjectManager

Here is my code:

    protected function setUp()
{
    $objectManager = new \Magento\Framework\TestFramework\Unit\Helper\ObjectManager($this);
    $this->scopeConfig = $objectManager->getObject('\Magento\Framework\App\Config\ScopeConfigInterface');
}

public function testgetImageCDNConfigValue()
{
    $this->scopeConfig->getValue($this->path, \Magento\Store\Model\ScopeInterface::SCOPE_STORE);
    if ($this->scopeConfig == null) {
        $this->assertFalse(true);
    } else {
        $this->assertTrue(true);
    }
}

I can get every object I want by using testObject \Magento\Framework\TestFramework\Unit\Helper\ObjectManager but whenever I want to get \Magento\Framework\App\Config\ScopeConfigInterface

  Fatal error: Cannot instantiate interface
  Magento\Framework\App\Config\ScopeConf igInterface in
  C:\xampp\htdocs\magento\vendor\magento\framework\TestFramework\Un
  it\Helper\ObjectManager.php on line 162


texts: Customer registration problem. Page reload after submit

texts:
I have two magento websites in domain and subdomain like test.com and test.test.com.

In Domain website and admin panel works fine.
But In Subdomain website the customer registration not done.After submit it only reload the registration page. I also enable log and check the log file but there is no error.

Also In Subdomain admin panel.I can login and view the admin panel dashboard.I can also view pages and blocks. But I can't create new page and update the page.After click on save it simply reload the page.

I use nginx server.I didn't change nginx server configuration after creating subdomain.

Please give me suggestion.I face this problem since last week.


texts: Magento 2: How to change image size of swatches?

texts:
I found the file to change the image size of Swatches here and it works when I change it in that place:

vendor/magento/module-swatches/etc/view.xml

However, if I move it to my theme it doesn't overwrite the file and doesn't work. My path to override is:

app/design/frontend/name/themename/Magento_Swatches/etc/view.xml

Is this path wrong? Do etc files have a different path to be placed than phtml files?


texts: Magento 2 - Adding a CMS page link to menu

texts:
Although this sounds really straight forward I can't work it out. All the existing methods seem to be for Magento 1.x

I would like to have all my CMS pages in the top menu.


texts: Magento2 : getting 503 Service Unavailable error on change attribute set in product

texts:
In my magento2.x store when I change attribute set then the post request return "503 Service Unavailable" error in console.

POST request is :

/catalog/product/reload/id/296/type/configurable/store/0/popup/1/componentJson/1/prev_set_id/10/key/656ff14895b6b0084f246bd058fbcb5a779de375a493f9051af6d76262847785/?set=9&isAjax=true

And in "var/report" there is a report file with following error :

a:4:{i:0;s:49:"Invalid UI Component element name: 'product_form'";i:1;s:2874:"#0 /home/domain/public_html/vendor/magento/framework/View/Element/UiComponentFactory.php(144): Magento\Ui\Model\Manager->prepareData('product_form')
#1 /home/domain/public_html/vendor/magento/framework/View/Layout/Generator/UiComponent.php(125): Magento\Framework\View\Element\UiComponentFactory->create('product_form', NULL, Array)
#2 /home/domain/public_html/vendor/magento/framework/View/Layout/Generator/UiComponent.php(93): Magento\Framework\View\Layout\Generator\UiComponent->generateComponent(Object(Magento\Framework\View\Layout\Data\Structure), 'product_form', Array, Object(Magento\Framework\View\Layout\Interceptor))
#3 /home/domain/public_html/vendor/magento/framework/View/Layout/GeneratorPool.php(86): Magento\Framework\View\Layout\Generator\UiComponent->process(Object(Magento\Framework\View\Layout\Reader\Context), Object(Magento\Framework\View\Layout\Generator\Context))
#4 /home/domain/public_html/vendor/magento/framework/View/Layout.php(327): Magento\Framework\View\Layout\GeneratorPool->process(Object(Magento\Framework\View\Layout\Reader\Context), Object(Magento\Framework\View\Layout\Generator\Context))
#5 /home/domain/public_html/vendor/magento/framework/View/Layout/Builder.php(129): Magento\Framework\View\Layout->generateElements()
#6 /home/domain/public_html/vendor/magento/framework/View/Layout/Builder.php(65): Magento\Framework\View\Layout\Builder->generateLayoutBlocks()
#7 /home/domain/public_html/vendor/magento/framework/View/Layout.php(244): Magento\Framework\View\Layout\Builder->build()
#8 /home/domain/public_html/vendor/magento/framework/View/Layout.php(935): Magento\Framework\View\Layout->build()
#9 /home/domain/public_html/var/generation/Magento/Framework/View/Layout/Interceptor.php(37): Magento\Framework\View\Layout->getOutput()
#10 /home/domain/public_html/vendor/magento/framework/View/Result/Layout.php(181): Magento\Framework\View\Layout\Interceptor->getOutput()
#11 /home/domain/public_html/vendor/magento/framework/View/Result/Layout.php(164): Magento\Framework\View\Result\Layout->render(Object(Magento\Framework\App\Response\Http\Interceptor))
#12 /home/domain/public_html/var/generation/Magento/Framework/View/Result/Layout/Interceptor.php(24): Magento\Framework\View\Result\Layout->renderResult(Object(Magento\Framework\App\Response\Http\Interceptor))
#13 /home/domain/public_html/vendor/magento/framework/App/Http.php(139): Magento\Framework\View\Result\Layout\Interceptor->renderResult(Object(Magento\Framework\App\Response\Http\Interceptor))
#14 /home/domain/public_html/vendor/magento/framework/App/Bootstrap.php(258): Magento\Framework\App\Http->launch()
#15 /home/domain/public_html/index.php(141): Magento\Framework\App\Bootstrap->run(Object(Magento\Framework\App\Http))
#16 {main}";s:3:"url";s:196:"/admin_o029x8/catalog/product/reload/id/296/type/configurable/store/0/popup/1/componentJson/1/prev_set_id/10/key/656ff14895b6b0084f246bd058fbcb5a779de375a493f9051af6d76262847785/?set=9&isAjax=true";s:11:"script_name";s:10:"/index.php";}

How to fix this error?


texts: Create new containers and move inside others

texts:
How do I create a new container referencing a parent container and move inside other containers. What I try

 <referenceContainer name="content">
        <container name="product.container" as="productContainer" htmlTag="div" htmlClass="product-container">
        </container>
</referenceContainer>
<move name="product.info.main" destination="product.container" />
<move name="product.info.media" destination="product.container" />


texts: 'Ground' shipping on FedEx does not show up on the front end. I had to set Residential Delivery to NO! We send to both residential AND business

texts:
Magento ver. 1.9.1.0

Added the 'Ground' shipping option in the Admin under the DEFAULT configuration scope but it does not appear on the front end. It only shows the following options on the front end:

 Home Delivery $17.35
 Express Saver $22.72
 Standard Overnight $33.29
 Priority Overnight $35.15

I cleared all Cache after adding this option and re-indexed but it did not help.

I had to set the Residential Delivery to NO in order to get the Ground shipping option to appear on the front end (as per here - 'Ground' not appearing in FedEx shipping method magento ) Why is that? And does it have any negative affects for us? (we do deliver to residential AND business addresses)

We actually need both - ground AND home delivery. How can I accomplish that??


texts: How to add a Gift Card type product to the cart via REST API?

texts:
I can't work out the syntax for adding a Gift Card product to the cart using the POST /rest/V1/carts/mine/items REST API endpoint. What product options need setting?
I gather that it needs giftcard amount, giftcard message, sender and recipient name and email address but how do I actually format that into a request body?


texts: Can only get simple product's thumbail or small_image but not both in helper function

texts:
I have a function to retrieve the URLs of a configurable product's simple product images in the product listing. The problem is, I am not able to retrieve both, but only small image OR thumbnail of each simple product - it seems as if the variable containing the small image url gets "overwritten" by the thumbnail variable.

Here's the relevant code (without elseif and else statements):

public function getSimpleProductImages($id, $code)
{
    $values = $this->_storageModel->getOptions($id, $code);

    if ($values){
        foreach ($values as $Key => $attributecolor) {
            $product = Mage::getModel('catalog/product')->load($id);
            $childIds = Mage::getModel('catalog/product_type_configurable')->getChildrenIds($product->getId());
            $simpleProducts = Mage::getModel('catalog/product_type_configurable')->getUsedProducts(null,$product);
            $SmallImage = array();
            $ThumbImage = array();

            foreach($simpleProducts as $simpleProduct) {
            if($Key == $simpleProduct->getColorManufacturer() && $simpleProduct->getSmallImage() !='no_selection'){
                $SmallImage[$simpleProduct->getColorManufacturer()] = Mage::helper('catalog/image')->init($simpleProduct, 'small_image')->resize(160);
                $ThumbImage[$simpleProduct->getColorManufacturer()] = Mage::helper('catalog/image')->init($simpleProduct, 'thumbnail')->resize(160);
                }
            }

            $attributes = Mage::getModel('eav/entity_attribute_option')->getCollection()->setStoreFilter()->join('attribute','attribute.attribute_id=main_table.attribute_id', 'attribute_code');
            foreach ($attributes as $attribute) {
                if ($attribute->getOptionId() == $Key) {
                    $SmallImageUrl = $SmallImage[$attribute->getOptionId()];
                    $ThumbImageUrl = $ThumbImage[$attribute->getOptionId()];
                }
            }
        }
    }
}

In the end, both of the variables $smallurl and $thumburl contain the URL of the thumbnail which is retrieved after the small image URL. If I just use one variable, I get the correct URL.

Any ideas???


texts:
I have Magento 2.2 installed locally using composer on an Apache webserver. Everything seems to be working besides from when I login into the admin and go System -> Web Setup Wizard it takes me to a 404 of /setup

What additional setup did I miss to enable this to work?


texts: Magento ver. 2.2.3 Catalog Category URL rewrite

texts:
Some of the catalog category URL are not been generated and are showing URLs as http://xxx.xxx.xxx.xxx/magento223/catalog/category/view/id/111/

this is an issue in only 20 categories and while I have almost 500 categories.

Do we have a checklist for this?


texts: Magento 2: Adding Extra Parameters to Exception

texts:
I need to return error codes instead of messages in the exception.

For example, what I am looking for is below

throw new \Magento\Framework\Exception\LocalizedException(__("number is incorrect"),"Err123");

So that only Err123 is will be returned as web API output instead of the message.

Is there a way to do this with existing Exception classes or a new exception class needs to be created?


texts: Cart Checkout problem in my Magento galabrand theme

texts:
I an new developer. I work with magento. Everything is ok but when i press cart checkout then show an error.

  Fatal error: Allowed memory size of 33554432 bytes exhausted (tried to
  allocate 3200 bytes) in
  /home/thebdmar/public_html/app/design/frontend/default/galabrandstore/template/page/html/head.phtml
  on line 46

Please advice me .

I got a solution "memory_limit must be 64M or more." ----> this is currect.
Thanks


texts: Relationship between block, controller and model - magento

texts: I am new guy to magento. I have seen $this->functionName() in template file of particular module. And then functionName() is placed under block. My question is Can I call any controller function or model function from block? Any relationship between block with controller and model?


texts:
I saw having option to add video from Vimeo and Youtube.

Can i upload video directly from admin product page?

Please let me know.


texts: Restrict user access to viewing prices in the admin panel (acl)

texts: how to implement functionality that will hide product prices from the user group. I've seen such a feature in an entrepreneurial Magento, but I can't figure out how to implement such a functionality.


texts: Magento 2 - Save Extension Attribute afterSave() returns void

texts:
I've been looking into extension attributes from various articles and tutorials:

https://store.fooman.co.nz/blog/an-introduction-to-extension-attributes.html
https://devdocs.magento.com/guides/v2.2/extension-dev-guide/extension_attributes/adding-attributes.html

Easy to explain, but the one thing that came up for me is adding an extension attribute to the CartInterface model. Basically, if I want to add a plugin for the save() repository model it does not return anything (void). How would I go about retrieving the recently saved Quote/Cart going by the above two methods. Right now I just have a method that puts data into the extension attribute, but the data is not persistent elsewhere.

    $quote = $this->quoteRepository->getActive($cartId);

    // Extension Attributes
    $quoteExtension = $quote->getExtensionAttributes();
    $quoteExtension->setFromApp(true);

    $this->quoteRepository->save($quote);


texts: Magento 2: What is the purpose of "_replica" tables?

texts:
I'm newbie in Magento but I have a store that started in 2.2 and is now updated to 2.4.1.
What is the exact purpose or _replica tables? The only mentioning is that they help prevent deadlock but how exactly this process work? Most of my _replica tables are empty when indexing is not running but it seems that Magento only grows catalogrule_product_price_replica table.
I have 1 million simple products and a handful of price groups and the catalogrule_product_price_replica table has data from every day starting in mid November and this table now grew to more than 450 million rows.
Could some point me to a nice description of _cl, _replica and _temp######## tables and when they are created by cron and which can be manually truncated when cron dies?
Any feedback appreciated!


texts: Allow more decimals in price field - Magento 2

texts:
I know that Magento provides the ability to use up to four decimals in the price field, but I need even more for certain products. The price could be for example 0.09857 and it is not up to me to round the price up, as the price comes from the original manufacturer and we need to stick to it precisely.

The price is just a base price that's going to be multiplied, as you might have guessed.

So is it possible to allow more decimals in the price field without hacking the core?


texts: Magento 2 - custom register form for companies

texts:
I need to create a landing page for company registrations. Compared to the private page, this form contains more fields. What is the best way to make this landing?
Is it better to develop a custom controller (inheriting the original Mage_Customer)?
Or an html block with a custom template and an observer?


texts: How to export CUSTOMERS from 1.3.1 to 1.9.1.? Is it even possible?

texts:
I've tried and I've tried and I've tried...

I do an EXPORT of CUSTOMERS from an older version of Magento (1.3.1) to the latest (1.9.1) but when I try to IMPORT it on the 1.9.1 version - it always give me Errors. I figured out already that I have to change website to _website and it seems to be better when I select to do the EXPORT without apostrophes. It seems that some of the customer's data is so long that it 'spills' over to the next row in the CSV - is this possible? What can I try to make the EXPORT/IMPORT work?

Here are the Errors I currently get on the IMPORT side:

Invalid value for 'group_id' in rows: 1, 3, 4, 5, 7, 8, 9, 10, 11, 12, 14, 15, 17, 18, 19, 20, 21, 23, 25, 26, 27, 30, 32, 34, 35, 37, 40, 42, 43, 44, 46, 47, 49, 50, 52, 54, 55, 56, 57, 58, 59, 60, 61, 62, 64, 65, 68, 69, 70, 71, 72, 74, 76, 78, 80, 81, 82, 83, 84, 86, 88, 89, 90, 91, 93, 95, 96, 97, 98

E-mail is not specified in rows: 2, 6, 29, 33, 41, 53, 63, 67, 77, 87

E-mail is invalid in rows: 13, 16, 22, 24, 28, 31, 36, 38, 39, 45, 48, 51, 66, 73, 75, 79, 85, 92, 94, 99, 100

 File is totally invalid. Please fix errors and re-upload file

Checked rows: 100, checked entities: 90, invalid rows: 100, total errors: 100


texts: If Maximum order value is above £X show Javascript Alert

texts:
I would like to ask for some advice on how I could show a Javascript alert to customers if their current shopping cart value is above say £300.

I am using an excellent observer based module from Inchoo that allows me to set maximum order values via admin. However, on the from end of our site we are using Ajax to add to the shopping cart so I would need to modify the Observer.php file in order to throw an exception in the form of a Javascript alert because the page simply freezes when the order value reaches the limit.

So far I have tried to add a

Mage::throwException("Quantity cannot exceed the maximum cart value ".$formattedPrice->getSingleOrderTopAmount());

to the Observer.php file but it hasn't worked as intended, also should I use the Incoo Observer.php or create a new one inside the Ajax add to cart module?

Observer.php from Inchoo module

    <?php

    class Inchoo_MaxOrderAmount_Model_Observer
{
    private $_helper;

    public function __construct()
    {
        $this->_helper = Mage::helper('inchoo_maxorderamount');
    }

    /**
     * No single order can be placed over the amount of X
     */
    public function enforceSingleOrderLimit($observer)
    {
        if (!$this->_helper->isModuleEnabled()) {
            return;
        }

        $quote = $observer->getEvent()->getQuote();

        if ((float)$quote->getGrandTotal() > (float)$this->_helper->getSingleOrderTopAmount()) {

            $formattedPrice = Mage::helper('core')->currency($this->_helper->getSingleOrderTopAmount(), true, false);

            Mage::getSingleton('checkout/session')->addError(
                $this->_helper->__($this->_helper->getSingleOrderTopAmountMsg(), $formattedPrice));

            Mage::app()->getFrontController()->getResponse()->setRedirect(Mage::getUrl('checkout/cart'));
            Mage::app()->getResponse()->sendResponse();
            exit;
        }
    }

    /**
     * An email is sent to admins when an order over X total price is placed in order to investigate
     */
    public function pushOrderAmountNotification($observer)
    {
        $order = $observer->getEvent()->getOrder();

        if ((float)$order->getGrandTotal() < (float)$this->_helper->getOrderAmountNotification()) {
            return;
        }

        $storeId = $order->getStoreId();

        if (!$this->_helper->isModuleEnabled()) {
            return;
        }

        try {
            $notifyToEmails = $this->_helper->getNotifyToEmails();

            if (empty($notifyToEmails)) {
                return;
            }

            $templateId = $this->_helper->getOrderAmountNotificationEmailTemplate($storeId);
            $mailer = Mage::getModel('core/email_template_mailer');

            foreach ($notifyToEmails as $entry) {
                $emailInfo = Mage::getModel('core/email_info');
                $emailInfo->addTo($entry['email'], $entry['name']);
                $mailer->addEmailInfo($emailInfo);
            }

            $mailer->setSender(array(
                'name' => $this->_helper->getStoreEmailAddressSenderOption('general', 'name'),
                'email' => $this->_helper->getStoreEmailAddressSenderOption('general', 'email'),
            ));

            $mailer->setStoreId($storeId);
            $mailer->setTemplateId($templateId);
            $mailer->setTemplateParams(array(
                'order' => $order,
            ));

            $mailer->send();

        } catch (Exception $e) {
            Mage::logException($e);
        }
    }
}

My question is where would I add the function to use a Javascript alert?


texts: How to enable the Slick-Slider for a product grid on the Product description page (PDP page)?

texts:
I have a home page on which there are couple of slick enabled sliders working fine, although I'm trying to enable slick slider for a product grid on the pdp page, but it doesnt work. What i have done is add the classes of my product grid at the jquery section in grid.phtml. Can some one help me resolve this?
the grid.phtml jquery code:
jQuery(".block.related .block-content .products-grid .product-items").slick({
            dots: false,
            arrows: true,
             prevArrow:"<button type='button' class='slick-prev pull-left'><</button>",
            nextArrow:"<button type='button' class='slick-next pull-right'>></button>",
            infinite: true,
            speed: 300,
            slidesToShow: 4,
            slidesToScroll: 4,
            responsive: [
                {
                    breakpoint: 1280,
                    settings: {
                        slidesToShow: 3,
                        slidesToScroll: 3
                    }
                },
                {
                    breakpoint: 768,
                    settings: {
                        slidesToShow: 2,
                        slidesToScroll: 2
                    }
                },
                {
                    breakpoint: 600,
                    settings: {
                        slidesToShow: 1,
                        slidesToScroll: 1
                    }
                }
            ]
        });

the product list template:


texts: Redis Session Error: Successfully broke lock for ID sess_ebfc12b22fa8c8e1fb81dca122fcdda6 after 5.01422 seconds

texts:
I am using Redis to store sessions and getting the error:

  [2019-11-26 09:51:32] main.INFO: ip-10-0-0-78|28852: Successfully broke lock for ID sess_ebfc12b22fa8c8e1fb81dca122fcdda6 after 5.01422 seconds (10 attempts). Lock: 12
  Last request of broken lock: POST pp-www.revivermx.com/rest/default/V1/carts/mine/payment-information /customer/section/load/?sections=messages&force_new_section_timestamp=true&_=1574761818952 [] []
  [2019-11-26 09:51:37] main.WARNING: ip-10-0-0-78|28670: Did not write session for ID ebfc12b22fa8c8e1fb81dca122fcdda6: another process took the lock. /rest/default/V1/carts/mine/payment-information [] []

I have tried everything and also tried with updating max_concurrency values as well. But still facing issues.

In actual, while I am placing the order, then randomly I am getting redirected to Shopping Cart page (Empty Shopping Cart) after order is placed. Sometimes, it shows the Success page but most of the time redirects to the Shopping Cart page. Although orders are getting placed successfully.

After debugging, I found out that the session got invalidated before the rendering the Success page. Any help would be appreciated.

Redis configurations:

 'session' => [
   'save' => 'redis',
   'redis' => [
        'host' => 'redis',
        'port' => '6380',
        'password' => '',
        'timeout' => '2.5',
        'persistent_identifier' => '',
        'database' => '0',
        'compression_threshold' => '2048',
        'compression_library' => 'gzip',
        'log_level' => '1',
        'max_concurrency' => '12',
        'break_after_frontend' => '5',
        'break_after_adminhtml' => '30',
        'first_lifetime' => '600',
        'bot_first_lifetime' => '60',
        'bot_lifetime' => '7200',
        'disable_locking' => '0',
        'min_lifetime' => '60',
        'max_lifetime' => '2592000'
    ]
],


texts: magento vsprintf() [function.vsprintf]: Too few arguments translate.php

texts:
I was getting a white screen on my store, so i was trying to debug the error and it was showing this error. Anyone knows how to fix it?

    Array
(
    [type] => 2
    [message] => vsprintf() [function.vsprintf]: Too few arguments
    [file] => /home/vhosts/MYSITE/subdomains/test/httpdocs/app/code/core/Mage/Core/Model/Translate.php
    [line] => 416
)


texts:
Hi how do I add a TextArea in my Checkout Page? right now all I can find are ways to add a input field but is there a way to add a text area and not a text field? I'm planning to add a comment field to my checkout but I can't find any solution. Would appreciate your help on this.
<?php
$customAttributeCode = 'custom_field';
$customField = [
    'component' => 'Magento_Ui/js/form/element/abstract',
    'config' => [
        // customScope is used to group elements within a single form (e.g. they can be validated separately)
        'customScope' => 'shippingAddress.custom_attributes',
        'customEntry' => null,
        'template' => 'ui/form/field',
        'elementTmpl' => 'ui/form/element/input',
        'tooltip' => [
            'description' => 'this is what the field is for',
        ],
    ],
    'dataScope' => 'shippingAddress.custom_attributes' . '.' . $customAttributeCode,
    'label' => 'Custom Attribute',
    'provider' => 'checkoutProvider',
    'sortOrder' => 0,
    'validation' => [
       'required-entry' => true
    ],
    'options' => [],
    'filterBy' => null,
    'customEntry' => null,
    'visible' => true,
];

$jsLayout['components']['checkout']['children']['steps']['children']['shipping-step']['children']['shippingAddress']['children']['shipping-address-fieldset']['children'][$customAttributeCode] = $customField;


texts:
I am just testing magento2 from product page so i added one hidden field and added data URI of image like following

data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAABU

But when i go to the cart or checkout page it give me error due to this! Is there any issue passing huge data from product page. Following is error

Notice: unserialize(): Error at offset 199 of 65535 bytes in C:\wamp\www\m2learn\vendor\magento\module-catalog\Model\CustomOptions\CustomOptionProcessor.php on line 100 .

Note: I am not setting any custom option. I have cleared cache and generation folder. Might be due to post data is huge.


texts: Magento 2 : Information tab in Order View page design issue

texts:
No error in console tab neither in network.
though i am getting design issue in order information.


texts: Magento 2 - Show swatches of simple products (out of stock) in configurable product

texts:
Magento versión: 2.1.7

I have a configurable product with ALL its simple products without stock.
I need to show in the configurable product the swatches of size / color (disabled) of their associated simple products.

Is this possible?

I already developed a modification and if at least 1 simple product has stock it shows all the swatches (available and not available).

The problem is if there's no stock of any simple product of configurable.


texts:
I want to connect SFTP in magento 2 but not sure where to start.

I have seen some of the post regarding this but not understand where to put the code.

  Below is one of the link which I have referred.

How to connect SFTP in magento 2

Could anyone please help me?

Thanks in advance.


texts:
Displaying error like :

  There was no Home CMS page configured or found..

All other pages are working..


texts: Create custom category attribute - Changes not saving

texts:
I created a custom category attribute from the following source:http://ashsmith.co/2013/03/quick-tip-adding-custom-category-attributes-to-magento/

Added new attribute successfully, however, when I changed the name of the field and changed from textarea to dropdown menu, my changes weren't being reflected on backend.  I cleared cache, re-indexed site, and still nothing.  Am I missing something?


texts: custom attribute on product Filtered result is Always one in magento 2

texts:
I have added custom attribute on product, this is for learning purpose so I just added it with a name 'brand2'.

I just updated 4 products brand2 value to Adidas:

But unfortunately in the frontstore it only show one product for Adidas:

One shown after I click Brand2->Adidas:

My question is how to show 4 adidas shorts on the front-store search result ?


texts: Parts of the shop not working anymore after going live

texts:
I wanted to put my shop live on wednesday last week. Due to problems from my hoster, this was not possible, so it went live on thursday instead. When it was live, I encountered a problem with the purchase Button. It wasn't working anymore. (In my local version everything works fine). After Debugging for several hours, trying to fix the issue, I at the end thought, maybe  this was a server problem (given the fact that the server was down the day before). When calling the support center I let the support do a test purchase. She told me what she was doing and then clicked purchase and "poooff" the purchase went through.
I didn't do anything so wtf!?! Anyways I was happy that it worked. Until yesterday!
Around 5pm I guess, cause I got a call from a client, that the purchase button is not working. Till 10.30am everything still worked, cause there were purchases made.
Calling support center this time, unfortunately didn't have the same effect as yesterday.

I did some minor bugfixing yesterday (CSS stuff). Other things I undid. I have no clue, what went wrong at some point. I don't get error messages, at least none where I would think they have something to do with the purchase button not working. On my local version everything works! Compared the files, they are the same. I'm not a pro, so my debugging skills are limited.

Could someone please take a look at the page and make a test purchase? The site is in german so please click at a dish, choose a date, and click in den warenkorb.
After this click "zur kasse" and fill in some dummy data click "weiter", choose "auf rechnung, click "weiter". At the review check the two boxes. And click "kaufen".

Usually you should be forwarded to success page, but now just the loadie is shown and nothing happens. Can someone point me in the right direction here? I am searching for hours now and I don't have a promising lead yet.

Update

Could this cause the issue? The cookies are already expired, because the server ist 2 hours behind? I changed the cookie expire date to 86400 but that didn't help. So I think I would have to change the date on server.


texts:
This is first time I have seen in one extension, _notes folder. I am trying to understand what's the logic having this file.

https://www.magentocommerce.com/magento-connect/typechange-products.html

This extension has 2 files, that I don't understand

Module/controllers/Adminhtml/Catalog/_notes/filename.xml
Module/Model/_notes/filename.xml

In that file it has following content:

<?xml version="1.0" encoding="utf-8" ?>
<node>
     <file name="Observer.php" server="[example.vizz.extension]/public_html/" local="[some_numbers]" remote="[some_numbers]" />
</node>

In Module/controllers/Adminhtml/Catalog/_notes/filename.xml there is only file name different.

Any idea on this?

I know this is third party extension and most likely this question will get closed. But I am more of asking about the code/file that exist in this module.


texts: Is it acceptable to put lib folder inside module folder structure?

texts:
Before I used this code to include some packages:

require_once($this->dir->getPath('lib_internal') . '/vendor/module/nuevomailer/api.php');

Now Magento doesn't allow to use require_once anymore so I thought that the simplest way without creating another packages just for third party libraries would be to just create lib folder inside existing vendorname/modulename folder and call it like this:

    class Subscriber extends \Magento\Framework\Model\AbstractModel{
        protected $mailchimp;
        protected $phpmailer;
        ...
        public function _construct(
            \Vendorname\Modulename\Lib\Mailchimp $mailchimp,
            \Vendorname\Modulename\Lib\Phpmailer $phpmailer,
            ...
        function subscribe(){
            $this->mailchimp->subscribe();
        }

Is that acceptable method? I checked Magento modul file structure (https://devdocs.magento.com/guides/v2.3/extension-dev-guide/build/module-file-structure.html) and I couldn't find lib folder. Is it allowed to put any other folder into module directory?


texts: How to add bundle product to cart programmatically with custom price and quantity (of all products) in Magento 2?

texts:
I am struggling with Bundle Product add to cart programmatically in Magento 2.

Here I need to add all products with custom price and quantity and I want to do this operation in Product list.phtml file.

Can you help me with this, please?


texts:
I would like to add a custom option dynamically to a quote item and give it a price.

For example, a checkbox on the cart page that when ticked will add some extra options for the customer and add $5 more to the price of that item.

I am trying to use the product load after event and set the custom option there.

Can anyone help with this?


texts: Smile Elastic search extension does not working in custom theme Magento 2.3

texts:
I have installed smile elasticsearch extension and i am using Magento 2.3.
Everything configured fine from server side and admin side both.

If i enabled luma theme from backend and check for elasticsearch then it it work fine.Please check below screenshot.

But when i enabled third party theme(i am using clue theme) and check for elasticsearch then it does not working properly.Please check below screenshot.


texts: Are JavaScript events triggered during the onepage checkout of Magento?

texts:
I need to run some JavaScript to manipulate some fields upon checkout (auto-select a shipping option) on a Magento store. Because each stage of the onepage checkout accordion is loaded dynamically I cannot do this on page load, and instead need to do it when the relevant stage of the accordion is reached.

Is there a JavaScript event I can hook up to in order to achieve this? I would expect an event to be fired when the next step begins to load and then completes loading, but I can't find any documentation on it.

Does such a thing exist, or do I need to find a workaround?


texts: Magento2: What is the best practice to get collection

texts:
I know it is not a good practice to use objectManager to get collection. However, I don't know what is the advantage of using ModelFactory ($this->mymodelFactory->create()->getCollection()) over injecting Collection class directly in to the constructor?

For example following two codes generates same results:

Using Factory:

<?php

namespace Unit4\Module6\Controller\Demo;

use Magento\Framework\App\Action\Context;
use Unit4\Module6\Model\VendorFactory;

class Index extends \Magento\Framework\App\Action\Action
{

    protected $_vendorFactory;

    public function __construct(
        Context $context,
        VendorFactory $vendorFactory,
        array $data = array()
    ) {
        parent::__construct($context, $data);
        $this->_vendorFactory = $vendorFactory;
    }

    public function execute()
    {
        $vendorModel = $this->_vendorFactory->create();
        $vendorCollection = $vendorModel->getCollection();
        var_dump($vendorCollection->getData());
    }
}

Injecting the Collection class directly in the __construct() function:

<?php

namespace Unit4\Module6\Controller\Demo;

use Magento\Framework\App\Action\Context;
use Unit4\Module6\Model\ResourceModel\Vendor\Collection;

class Index extends \Magento\Framework\App\Action\Action
{

    protected $_collection;

    public function __construct(
        Context $context,
        Collection $collection,
        array $data = array()
    ) {
        parent::__construct($context, $data);
        $this->_collection = $collection;
    }

    public function execute()
    {
        $vendorCollection = $this->_collection;
        var_dump($vendorCollection->getData());
    }
}

So what is the advantage of using Factories here?


texts: How to get a good Google Pagespeed mobile score for a Magento2 site?

texts:
We migrated a website from Drupal to Magento. After the migration the website's Google Pagespeed scores are much lower.

With WordPress I can easily get to scores 99 for mobile and 100 for desktop. It's a bit harder with Drupal. I was hoping that the Magento community had figured this out like WordPress (after all, faster pages means more sales).  Now I'm pretty new to Magento myself, so I'm wondering, maybe the shop that handled the migration missed something important? Or is it generally hard to optimize Magento?

Plus the actual experience of opening a product page is sub-optimal: it takes about 7 seconds before the most important image is showing.

What are some things we can do to speed up our website? That will help us get a better Pagespeed score. After all, it's all about the Google SERPs.

Defer offscreen images
Serve images in next-gen formats
Properly size images
Eliminate render-blocking resources
Minify JavaScript
Defer unused CSS

Diagnostics
More information about the performance of your application.

Ensure text remains visible during webfont load
Minimize main-thread work 11.6 s
Reduce JavaScript execution time 7.4 s
Avoid an excessive DOM size 1,524 nodes
Serve static assets with an efficient cache policy 12 resources found
Avoid enormous network payloads Total size was 2,843 KB
Minimize Critical Requests Depth


texts: Filter Search Results using Attribute and Category

texts:
I have a custom requirement where I need to change the catalog search results.

What I need to do is to show the products based on attribute as well as category

For example if you search attribute pink, it will list down all the products on search page having the attribute pink assigned to them

Similarly, if a product is only assigned to category X and when you search X, it will list down all the products with category X assigned.

Do I need to change the Catalogsearch Model ?

How can I achieve this ?

Please Help.

Thanks.


texts:
I want to set and custom data like "loyality point" to a quote by id or by cart id in magento 2.
How can i achieve this.

Or

Is there any way to set custom data to a checkout session by API in magneto 2?

THANKS.


texts:
Another issue with building my admin module!! I can't get the page to show! Already have the page and drop down links showing without errors like I had last week. Now I can't get my template page to show up. What am I doing wrong with declaring these blocks?

Config.xml:

<?xml version="1.0"?>
<config>
    <modules>
        <Caitlinhavener_Addschool>
            <version>0.1.0</version>
        </Caitlinhavener_Addschool>
    </modules>

    <global>
        <blocks>
            <addschoolblock1>
                <class>Caitlinhavener_Addschool_Block</class>
            </addschoolblock1>
        </blocks>
        <helpers>
            <addschool>
                <class>Caitlinhavener_Addschool_Helper</class>
            </addschool>
        </helpers>
    </global>

    <admin>
        <routers>
           <adminhtml>
                <use>admin</use>
                <args>
                    <modules>
                        <Caitlinhavener_Addschool after="Mage_Adminhtml">Caitlinhavener_Addschool</Caitlinhavener_Addschool>
                    </modules>
                </args>
           </adminhtml>
        </routers>
    </admin>
</config>

adminhtml.xml:

<?xml version="1.0"?>
<config>
    <menu>
        <SchoolMenu translate="title" module="addschool">
            <title>Schools</title>
            <sort_order>23</sort_order>
            <children>
                <myitem2 translate="title" module="addschool">
                        <title>Add Schools</title>
                        <action>adminhtml/addschool</action>
                        <sort_order>2</sort_order>
                </myitem2>
            </children>
        </SchoolMenu>
    </menu>
</config>

controllers/Addschoolcontroller.php:

<?php

class Caitlinhavener_Addschool_AddschoolController extends Mage_Adminhtml_Controller_Action
{
    public function indexAction()
    {
        $this->loadLayout();

        $this->_addLeft($this->getLayout()->createBlock('Caitlinhavener_Addschool_Block_ShowTabsAdminBlock'));

        $this->renderLayout();
    }
}

Block/ShowTabsAdminBlock.php:

<?php

class Caitlinhavener_Addschool_Block_ShowTabsAdminBlock extends Mage_Adminhtml_Block_Widget_Tabs
{
    public function __construct()
    {
        parent::__construct();
        $this->setId('add_school');
        $this->setTitle(Mage::helper('addschool')->__('Add Schools'));
    }

    protected function _beforeToHtml()
    {

        $this->addTab('add_public_school', array(
            'label'     => Mage::helper('addschool')->__('Add Public School'),
            'title'     => Mage::helper('addschool')->__('Add Public School'),
            'content'   => $this->getLayout()->createBlock("addschoolblock1/SampleBlockForTabAreaShowoffWithExtraInfo")->toHtml(),
            'active'    => false
        ));

        return parent::_beforeToHtml();
    }
}

Block/SampleBlockForTabAreaShowoffWithExtraInfo.php:

<?php

class Caitlinhavener_Addschool_Block_SampleBlockForTabAreaShowoffWithExtraInfo extends Mage_Adminhtml_Block_Template
{

    public function __construct()
    {
        parent::__construct();
        $this->setTemplate('Caitlinhavener/sample_for_tab_container.phtml');
    }
}


texts: How can I edit products on website scope?

texts:
When I edit a product in the admin area of Magento I can select to edit the product for the global scope or for any of the store scopes. I would like to edit the product for a website scope.

Is there some trick/ code/ extension which enabled editing products on the website scope?


texts:
I have uploaded my Magento site from localhost to live server. I already run following steps:

Change database configuration such as host, username, password,
dbname in app/etc/local.xml.
Delete/clear all cache and session in var/cache and var/session.
Replace local url (127.0.0.1/magento) with live site url (example: mydomain.com) in core_config_data

but I still found problem when I type live site URL in address bar, browser will redirect to local site URL again.


texts: Configurable Products - attribute label, "use default" issue

texts:
When I create a configurable product, in the tab "associated products" the checkbox for "use default", label for attribute is unchecked.

I have fixed this altering the product.js (line 404), adding attribute.use_default == null:

                if (attribute.use_default == '1' || attribute.use_default == null  ) {
                use_default_checked = ' checked="checked"';
                label_readonly = ' readonly="readonly"';
            }

This work fine.

However now I would like to set this for all the products that I have already created.

I will accept answer that help me to create a query on DB


texts: Inserts HTML line breaks before all newlines in description

texts:
In Magento 1 I have the following code in description.phtml for product view.

Where can I find/change that in Magento2? I cant find the file!!

<?php echo $this->helper('catalog/output')->productAttribute($this->getProduct(), nl2br($_description), 'description') ?>


texts:
I have created a user and given some admin role permissions, i want to get this user details like phone number etc, how can i get this?

$roles_users = Mage::getResourceModel('admin/roles_user_collection');
        foreach($roles_users as $roleuser):
          $user = Mage::getModel('admin/user')->load($roleuser->getUserId());
          $role_data = Mage::getModel('admin/user')->load($user->getUserId())->getRole()->getData();//print_r($role_data["role_name"]);die;

          if ($role_data["role_name"]=="callcentre"){
            echo '<br/>User : '.$user->getUserId()."|".$role_data["role_id"]."|".$user->getUsername()." | ".$user->getFirstname()."|".$role_data["role_name"]."|";
          }
        endforeach;


texts:
I have a flat module on my site, which doesnt have store view switcher on add/edit page. I want to enable store view switcher on these pages so i tried to add a field using tabs ( admin html ) but it is not working. This module was created with UMC ( ultimate module creator )

Is there a way to enable store view switcher for collections and convert flat module to eav module ?


texts:
The site I'm working on has changed the wishlist popup to a free samples popup.

I'm trying to edit the modal footer but I cannot find a template for it.

The developer before me has created a module to edit the content of the popup, but the footer and header is not included.

Is there another way around editing this modal popup?


texts: how to remove all reviews and order Magento

texts: How I can remove all review and order from magento by php query with out affect on my other magento functionality.


texts: invalid rows qty on catalog_category_product_index table after reindexing in magento2

texts:
I have imported large product qty with custom magmi port for magento2:

MariaDB [magento2]> select count(*) from catalog_product_entity;
+----------+
| count(*) |
+----------+
|  9974308 |
+----------+
1 row in set (2.45 sec)

Only one store view in this magento instance and lots of categories created (about 100k products in each category) which admin backend shows.

But after reindexing I saw that only 500 records are returned but block collection from each category, and then I realized that catalog_category_product_index was built incorrectly...

MariaDB [magento2]> select distinct count(product_id) from catalog_category_product_index;
+-------------------+
| count(product_id) |
+-------------------+
|            105179 |
+-------------------+

How to debug and resolve this issue ?


texts:
I'm using windows 8.1 pc. How do i update my magento 1.9.0 to 1.9.1. I can't just install a fresh version since I have multiple custom module on my application.

I also saw that you can update using magento connect manager. but I cannot find Mage_All_Latest on my list.


texts: Magento 1 : How to add search option for Attribute manage options?

texts:
I have added an attribute "Student Registraion No" in admin which have 24773 records. I want to a check a particular "Student Registration No." that no. is  added or not, but I could not check easily. I open one by one page and check no.

So, how to add a search option like product list in admin?


texts:
I want to set minimum order quantity (moq) based on category.

Say a product name A in catgeory 1 and category 2:

I want to set moq to be 2 for category 1 and moq to be 5 for category 2 based on which category user is browser.

Please guide me way to do this I need help to start off, i am new to Magento and need help in this issue.


texts: magento2: how to use product uploader in custom module

texts:
<?xml version="1.0"?>

<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/layout_generic.xsd">
    <referenceContainer name="content">
        <uiComponent name="test_form"/>
    </referenceContainer>
</layout>

I am using uiComponent  to generate the form. Now I want to use default magento image uploader in my module. After searching i found magento is using this code for multiple image upload.

<referenceContainer name="content">
        <uiComponent name="gallery_form"/>
        <referenceContainer name="product_form">
            <block name="gallery" class="Magento\Catalog\Block\Adminhtml\Product\Helper\Form\Gallery">
                <arguments>
                    <argument name="config" xsi:type="array">
                        <item name="label" xsi:type="string" translate="true">Images</item>
                        <item name="collapsible" xsi:type="boolean">true</item>
                        <item name="opened" xsi:type="boolean">false</item>
                        <item name="sortOrder" xsi:type="string">22</item>
                        <item name="canShow" xsi:type="boolean">true</item>
                        <item name="componentType" xsi:type="string">fieldset</item>
                    </argument>
                </arguments>
                <block class="Magento\Catalog\Block\Adminhtml\Product\Helper\Form\Gallery\Content" as="content">
                    <arguments>
                        <argument name="config" xsi:type="array">
                            <item name="parentComponent" xsi:type="string">product_form.product_form.block_gallery.block_gallery</item>
                        </argument>
                    </arguments>
                </block>
            </block>
        </referenceContainer>
    </referenceContainer>


texts: How to add new custom dynamic link in magento2 top header links?

texts:
I want to add a custom dynamic link on top gray navigation bar besides welcome message when a specific user with a specific customer group is logged in.
the main entry would be dynamic which will contain a changing numeric value via ajax.
and then under it will come menu items with independant dynamic links.
Similar to My account, My wishlist, Signout menu. but dynamic.
In short I need to get what is shown below:

Please guide where to start from.

I have searched but till now found only for mein menu custom links for cms etc.
I need in top grey section.


texts: Magento2 Element 'head': Character content other than whitespace is not allowed

texts:
I have a Magento 2.2 website that was moved to a new server and now when I go to the website I am presented with the below. Howeever I am not clear on what file the error exists within?? Any suggestions on how to figure out what file to go look in?

1 exception(s): Exception #0 (Magento\Framework\Config\Dom\ValidationException): Element 'head': Character content other than whitespace is not allowed because the content type is 'element-only'.

Line: 45


texts: How to rebuild Magento 1.3.2.4 corrupted database ready for migration to Magento 2.3.0

texts:
We have an existing old live Magento 1.3.2.4 website (which is completely backed up).

We have built a new Magento 2.3.0 website which is ready to go live, but just needs the old Magento 1.3.2.4 data migrated into it.

  Our first problem is the Magento 1.3.2.4 MySQL database was corrupted.

We have created a new default Magento 1.3.2.4 website using a copy of the original database and successfully run the Magento Database Repair Tool 1.2 as per the instructions.

The Database Repair Tool only found and fixed 2 errors:

Add missing foreign keys:

FK_CATEGORY_FLAT_CATEGORY_ID

FK_CATEGORY_FLAT_STORE_ID

to table "catalog_category_flat"

After the initial repairs, running the tool again found no errors.

However, the database is huge (about 280MB) and there are clearly more problems.

How can we clean up the database?

  Our second problem is Magento admin ‘Customers/Manage Customers’ only displays 13 customers, but this should be about 1000 customers.

All of the other missing customers and their data is still in the Magento store and visible when viewed via ‘Sales/Invoices’ and ‘Sales/Orders’.

Magento admin displays 1054 ‘Sales/Invoices’

Magento admin displays 1081 ‘Sales/Orders’

Magento admin displays 1002 'Sales/Shipments'

Magento admin displays 48 'Sales/Credit Memos'

Magento admin displays 945 'Catalog/Manage Products'

How can we recreate all of the hidden customers?

  Our third problem is how to export and migrate all the Magento 1.3.2.4 data into the new Magento 2.3.0?

We need all of the data including the following:

Orders,
Order addresses,
Order payments,
Payment transactions,
Order status history,
Quotes,
Invoices,
Invoice comments or Invoice items,
Shipments,
Shipment comments,
Shipped items,
Shipments tracking,
Credit Memos,
Credit Memo comments,
Credit Memo items,
Checkout fields,
Products,
Customers

How can we successfully migrate all of the data?


texts: Magento 2.3 - Product stock alert not display

texts:
I use Magento 2.3 and I create a custom theme based on Luma theme.

I enable the Magento_ProductAlert module from backend but the message "notify me when this product is in stock" is not display in frontend.

How I can check / fix this issue?

I will add here my backend settings:

Stores > Settings > Configuration > Catalog > Product Alerts

 Stores > Configuration > Catalog > Inventory > Stock Options

and this is my simple product configuration:


texts: What is the recommended page size for GETting sales orders through REST API calls?

texts: I am trying to make a GET call to the Magento 2 REST API to get all the sales orders. What is the recommended page size I should be using? Is there any upper limit on the page size?


texts: I just switched themes from Luma to Gicor1, and the Category bar went away. Where in the admin panel or the code can I make it appear again?


texts: Magento 2: Flatrate shipping price is not updating

texts:
In the first checkout step, where we are providing shipping address I'm updating flatrate price according to the zip code given. The updated price is saving to core_config_data table as usual.But when I take the payment step of checkout process flatrate shipping rate is still showing 0.00 in the order summary block. How can I solve this? Please refer the snapshot below

My flatrate admin area settings


texts: Add Discount coupon code box on checkout page in magento 1.9

texts:
We want to add Discount coupon code box on checkout page.
This coupon code box showing only on cart page we also want on checkout page.


texts: How to use ActionInterface insted of Deprecated Action class

texts:
I start learning magneto 2. I give it a try with Max Pronko's videos. Figure out some of the codes that are outdated, deprecated.
Here is my controller. Any suggestion on how to use ActionInterface here.
<?php
declare(strict_types=1);
namespace Isuru\FirstPage\Controller\Page;

use Magento\Framework\App\Action\Action;
use Magento\Framework\Controller\Result\Json;
use Magento\Framework\Controller\ResultFactory;

class View extends Action
{
    public function execute()
    {
        /** @var Json $jsonResult */
        $jsonResult = $this->resultFactory->create(ResultFactory::TYPE_JSON);
        $jsonResult->setData([
            'message' => 'First Page'
        ]);
        return $jsonResult;ActionInterface
    }
}


texts:
I can't access categories from backend and im getting magento's error page with log number.
Here is my log;

a:5:{i:0;s:176:"Cannot send headers; headers already sent in /home/petbesin/public_html/app/code/local/Meigee/CategoriesEnhanced/Model/Category/Attribute/Source/Block/Enabledisable.php, line 1";i:1;s:1371:"#0 /home/petbesin/public_html/lib/Zend/Controller/Response/Abstract.php(115): Zend_Controller_Response_Abstract->canSendHeaders(true)
#1 /home/petbesin/public_html/app/code/local/Siteground/SuperCacher/Model/Observer/Varnish.php(45): Zend_Controller_Response_Abstract->setHeader('X-Cache-Enabled', 'False')
#2 /home/petbesin/public_html/app/code/core/Mage/Core/Model/App.php(1338): Siteground_SuperCacher_Model_Observer_Varnish->setCacheFlagHeader(Object(Varien_Event_Observer))
#3 /home/petbesin/public_html/app/code/core/Mage/Core/Model/App.php(1317): Mage_Core_Model_App->_callObserverMethod(Object(Siteground_SuperCacher_Model_Observer_Varnish), 'setCacheFlagHea...', Object(Varien_Event_Observer))
#4 /home/petbesin/public_html/app/Mage.php(448): Mage_Core_Model_App->dispatchEvent('http_response_s...', Array)
#5 /home/petbesin/public_html/app/code/core/Mage/Core/Controller/Response/Http.php(83): Mage::dispatchEvent('http_response_s...', Array)
#6 /home/petbesin/public_html/app/code/core/Mage/Core/Controller/Varien/Front.php(184): Mage_Core_Controller_Response_Http->sendResponse()
#7 /home/petbesin/public_html/app/code/core/Mage/Core/Model/App.php(354): Mage_Core_Controller_Varien_Front->dispatch()
#8 /home/petbesin/public_html/app/Mage.php(684): Mage_Core_Model_App->run(Array)
#9 /home/petbesin/public_html/index.php(87): Mage::run('', 'store')
#10 {main}";s:3:"url";s:82:"/index.php/guardianv2/catalog_category/index/key/53c82eadedd4568a85115ced74f3809b/";s:11:"script_name";s:10:"/index.php";s:4:"skin";s:5:"admin";}

Any ideas?


texts: Override Adminhtml Order Create.php file in Enterprise

texts:
I want to override Mage_Adminhtml_Model_Sales_Order_Create file.
For this purpose I am doing below code :

config.xml

<adminhtml>
    <rewrite>
        <sales_order_create>Namepspace_Module_Model_Adminhtml_Create</sales_order_create>
    </rewrite>
</adminhtml>

Above code is working in any community version of magento.But In enterprise that is not working. So for solve that I also tried below but not working :

<adminhtml>
    <rewrite>
        <sales_order_create>Namepspace_Module_Model_Adminhtml_Sales_Order_Create</sales_order_create>
    </rewrite>
</adminhtml>

Help me. Thank you


texts:
Im new in magento, i have this error when I enter  in System -> Web Setup Wizard -> Extension Manager

My error text:

Command "show" failed: Package authorizenet/magento-module-authorizenet not found in /var/www/html/composer.json

My magento version: ver.2.3.4
Capture of my composer.json in root Magento directory

My capture composer.json text

"authorizenet/magento-module-authorizenet": "^1.0"

Thanks for Read :)


texts: Show only necessary product information in backend for defined user group

texts:
I'd like to update the products in my shop from various users who should only see the absolutely needed input fields so that no-one gets confused.

The entries 'Webdesign' and 'Geschenkoptionen' should be hidden for users with usergroup 'Produktpflege' (Anm.: German for 'Product Maintenance').

After doing some reasearch it seem preferably to create an own extension.

I guess I found the right english Post already: Hide Attributes and Other Fields in Product Edit Backend Unfortunately I am new to this, this is why the Post does not explain enough for me. Right now I am not sure which extension should be extended and I don't know how I can assign it to certain users.

Could someone please give me a hint for my XML-files?

Big thanks in advance.


texts: Magento2.3- Inventory Management unable to decrease Salable Quantity

texts:
I am using Magento2.3.2 version.

Example:

1)I added one product with 5 Quantity.

So, Quantity is now 5 and Salable Quantity also 5.

2)Now I realize I have only 4 quantity and by mistake, I added 5.

So, I update the Quantity from 5 to 4.

So now Quantity is 4 and salable quantity is 5.

How to decrease Salable Quantity?

Another Example:

1)Create a new product with 1 quantity.

So, Quantity is 1 and Salable quantity is 1.

2)Now that product is sold offline.

So, I edit the product and set Quantity to 0.

So now the Quantity is 0 but the Salable Quantity is 1.

How to decrease Salable Quantity?

Any trick from admin or any module for that?


texts: Out of stock product redirects in login panel of magento

texts:
How to avoid out of Stock products to redirect visitors on the login page of magento

Update

On my Website the products are available even though they are out of stock and when a user clicks on them, it redirects them to the login page.

For Example: I am a user of this website. I want to buy a product : Sugar.
When i click on "sugar" this redirects me directly at the admin panel login page of magento.

the configuration from the admin panel is :Admin >> System >> Configuration >> Catalog >> Inventory >> Stock Options Display Out of Stock product -> No

but still they are on website. How to give users a 404 error page in this case?


texts: Magento 2 graphql get the cms block based on store

texts:
I am trying to get the cms block based on store, but it is alway returning the default store block content.

The query I used :

{
  cmsBlocks(identifiers: "login-data") {
    items {
      identifier
      title
      content
    }
  }
}

The above one is not giving block content based on the store I set in HTTP HEADER!!

I saw the cms block resolver and did not find any store-based cms block fetch

vendor/magento/module-cms-graph-ql/Model/Resolver/Blocks.php


texts: how to insert tracking link for shipment in magento from csv

texts:
I have csv having track number, order number, carrier name and tracking link now i want to insert tracking link for shipment in magento from csv

if (($handle = fopen("".$webshopimport_path."\\CSV\\trackandtrace.csv", "r")) !== FALSE)
{
    while (($data = fgetcsv($handle, 100000, ",")) !== FALSE)
    {
        Mage::init();
        $comment = null;
        $email = false;
        $includeComment = false;
        $orderId = $data[5];                                                        //get ordernumber from csv
        $order = Mage::getModel('sales/order')->loadByIncrementId($orderId);
        $convertor = Mage::getModel('sales/convert_order');
        $shipment = $convertor->toShipment($order);

        foreach ($order->getAllItems() as $orderItem)
        {
            if (!$orderItem->getQtyToShip()) {
                continue;
            }
            if ($orderItem->getIsVirtual()) {
                continue;
            }
            $item = $convertor->itemToShipmentItem($orderItem);
            $qty = $orderItem->getQtyToShip();
            $item->setQty($qty);
            $shipment->addItem($item);
        }

        $trackdata = array();
        $trackdata['carrier_code'] = $data[2];                                   //get carrier_code from csv
        $trackdata['title'] = $data[2];                                          //get title from csv
        $trackdata['number'] = $data[3];                                         //get track number from csv
        $trackdata['track_link'] = $data[4];                                         //get track link from csv

        $track = Mage::getModel('sales/order_shipment_track')->addData($trackdata);
        $shipment->addTrack($track);
        //echo "<pre>"; print_r($shipment);echo "<pre>"; exit;

        Mage::register('current_shipment', $shipment);

        $shipment->register();
        $shipment->addComment($comment, $email && $includeComment);
        $shipment->setEmailSent(true);
        $shipment->getOrder()->setIsInProcess(true);
        echo "<pre>"; print_r($shipment);echo "<pre>"; exit;

        $transactionSave = Mage::getModel('core/resource_transaction')
            ->addObject($shipment)
            ->addObject($shipment->getOrder())
            ->save();

        $shipment->sendEmail($email, ($includeComment ? $comment : ''));
    }
    fclose($handle);
}

I am able to save track number, carrier name but not to save tracking link, please help me for this query


texts: How can I write custom query in magento in magento 2 format?

texts:
// SQL QUERY

SELECT*, ( ACOS( COS( RADIANS( $clat ) )* COS( RADIANS( lat ) )* COS(
RADIANS( lng ) - RADIANS( $clng ))
+SIN( RADIANS( $clat ) )* SIN( RADIANS( lat ) ))* 6371) AS distance_in_km FROM store_locator  HAVING (distance_in_km <= $cradius)
ORDER BY distance_in_km ASC LIMIT 10;

// I want to write it in this format
    $this->getSelect()->where('6371 * acos(cos( radians('.$data['lat_search'].')) * cos( radians( lat ) ) * cos( radians( lng ) - radians('.$data['long_search'].')) + sin( radians('.$data['lat_search'].') ) * sin( radians( lat ) ) ) < '.$data['radius']);


texts: Is it possible to change timezone's scope to store?

texts:
After googling how to set the timezone for each Magento store I can see that there is a lot of confusion around.

All blog posts I've read confuse "website" with "store name" and "store view". A lot of guides out there tell you that one can easily change magento's timezone for each store. This left me puzzled as I'm unable to change it in mine for each store.

Indeed, the docs say that timezone has a scope of "website" http://www.magentocommerce.com/wiki/modules_reference/english/mage_adminhtml/system_config/edit/general

So I gather that by default one can only change the timezone for each website, and NOT at "store name" level. This is really bad for transactional emails however.

I was wondering if anybody knows how to change the scope of the timezone setting to store name level, or any other way in which this can be achieved.


texts: Magento2 - local / staging / production deployment & gitignore

texts:
This could be one kind of discussion more than a question.

I'd like to know which deployment policy you follow with Magento2 & local > staging > production environments

After some tries we've decided the best (or at least, the most solid) approach would be this gitignore file including vendor folder in git.

.DS_Store
/.buildpath
/.cache
/.metadata
/.project
/.settings
atlassian*
/nbproject
/sitemap
/sitemap.xml
/.idea
/.gitattributes
/app/config_sandbox
/app/etc/config.php
/app/etc/env.php
/app/code/Magento/TestModule*
/lib/internal/flex/uploader/.actionScriptProperties
/lib/internal/flex/uploader/.flexProperties
/lib/internal/flex/uploader/.project
/lib/internal/flex/uploader/.settings
/lib/internal/flex/varien/.actionScriptProperties
/lib/internal/flex/varien/.flexLibProperties
/lib/internal/flex/varien/.project
/lib/internal/flex/varien/.settings
/node_modules
/.grunt
/pestle.phar
/pub/media/*.*
!/pub/media/.htaccess
/pub/media/catalog/*
!/pub/media/catalog/.htaccess
/pub/media/customer/*
!/pub/media/customer/.htaccess
/pub/media/downloadable/*
!/pub/media/downloadable/.htaccess
/pub/media/import/*
!/pub/media/import/.htaccess
/pub/media/theme/*
/pub/media/theme_customization/*
!/pub/media/theme_customization/.htaccess
/pub/media/wysiwyg/*
!/pub/media/wysiwyg/.htaccess
/pub/media/tmp/*
!/pub/media/tmp/.htaccess
/pub/media/captcha/*
/pub/static/***
!/pub/static/.htaccess

/var/*
!/var/.htaccess

.unison*
/sync.sh

So we run composer only in local environment: As any new extension, or software upgrade is tested in local, then validated and committed. We'd probably then include app/etc/config.php file in git too but that file is rewriten when running setup:upgrade, right?

Including vendor means repository size will be bigger than (maybe) recommended but this way when deploying code, we just run the sequence:

bin/magento setup:upgrade
bin/magento setup:di:compile (optional)
bin/magento setup:static-content:deploy

Related info:
http://www.damianculotta.com.ar/magento/gitignore-y-la-estrategia-de-deploys-en-magento2

See why we choose compile command as optional Magento 2 - setup:di:compile ?

UPDATE

The truth is we are having some problems when deploying code changes in our published Magento 2 projects

Changes work in local & staging (checked in both modes: developer & production... although we conceptually configure that environments in developer mode), but some of them don't work in production environment (in production mode), etc... so I am not sure we are following the right strategy. I'd like to see what's the appropriated command sequence, and the relevance of the order in that commands

In fact, every day I am less convinced about the utility of Magento 2 production mode, unless you are not going to change anything in the project. Can you change my mind?


texts: Magento 2 on nginx with another nginx as a proxy

texts:
I have a VM running ngnix with magento 2 . internally , my vm is resolved by :
marketplace.corp.mycloud.com

From the internet, it is resolved with :
marketplace.mycloud.com

Http is working fine so far. and I want to keep the 2 options for demo purposes and later for inspections..

However, HTTPS is not working and I have been puzzled by all comments..

So here is the content of my nginx file of My Magento VM :

    upstream fastcgi_backend {
    server   unix:/run/php/php7.2-fpm.sock;
    }

    server {
            server_name marketplace.corph.mouradcloud.com;
            index  index.php index.html index.htm;
            listen 80;
            client_max_body_size 100M;
            set $MAGE_ROOT /var/www/marketplace.corph.mouradcloud.com/;
            set $MAGE_MODE developer;
            access_log /var/log/nginx/marketplace.corph.mouradcloud.com-access.log;
            error_log /var/log/nginx/marketplace.corph.mouradcloud.com-error.log;
            include /var/www/marketplace.corph.mouradcloud.com/nginx.conf.sample;
            }

Now here is the content of my reverse proxy nginx configuration :

        upstream marketplaceserver {
            server marketplace.corph.mouradcloud.com;
        }

        server {
        listen 80;
        listen 443;
        server_name marketplace.mouradcloud.com;
        ssl_certificate /XXXX/XXXX/XXXX/marketplace.mouradcloud.com/fullchain.pem; # managed by Certbot
        ssl_certificate_key /XXXX/XXXX/XXXX/marketplace.mouradcloud.com/privkey.pem; # managed by Certbot
        include /etc/letsencrypt/options-ssl-nginx.conf; # managed by Certbot
        ssl_dhparam /etc/letsencrypt/ssl-dhparams.pem; # managed by Certbot

                location / {
                proxy_set_header X-Real-IP  $remote_addr;
                proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
                proxy_set_header X-Forwarded-Proto https;
                proxy_set_header X-Forwarded-Port 443;
                proxy_set_header Host $host;
                proxy_pass http://marketplaceserver;
                }

        }

The target is this one :

I have been switching configurations but I was not able to get it work, ideally, I would like to keep all configuration to the frontend proxy and not touch the magento configurations..

Any clue ?


texts: Class 'Mage' not found and include(): Failed opening 'Mage.php' error on Magento

texts:
We have some many error lines on httpd error log, about 10-15 errors for every day, on different time:

PHP Warning:  include(Mage.php): failed to open stream: No such file or directory in /var/www/html/lib/Varien/Autoload.php on line 94
...
PHP Fatal error:  Class 'Mage' not found in /var/www/html/app/code/core/Mage/Core/functions.php on line 244
...
PHP Fatal error:  Class 'Mage' not found in /var/www/html/app/code/core/Mage/Core/Model/Resource/Session.php on line 108

Any error not found related to the issue on Magento logs. Some times some customers cannot be login, is it result of the issue given above?

It seems these errors appeared after upgrading EE 1.13.1 to EE 1.14.1 month ago. Followed this one, but we have some difficulties to catch error as this error is only on live instance. Magento instance status:

Uses Redis for session, cache and fpc
Uses load balancer
about 2000 SKUs
about 20000 visits per day
Compilation mode is off

Issue is not permanent, it is available only some times (maybe peak time of the day)

Any help will be appreciated.

Update

Unknown and strange thing is I have set full permission to var folder (chmod 777 -R var/*) and issue has gone away. But var directory was be available for web-server user and group: magento logs, magento-connect, system backup was worked perfectly as a fact of valid permission of the folder. Consider this change while giving some diagnose.


texts: Add custom options to products programmatically

texts:
Hi I am developing a script which makes simple products for magento store. I have added the products through the script but now I want to add custom options to the added simple product. How would I do it through my custom script? Here is how I am adding the product:

$product = Mage::getModel('catalog/product');
$product
        ->setStoreId($store_id) //you can set data in store scope
        ->setWebsiteIds(array(1)) //website ID the product is assigned to, as an array
        ->setAttributeSetId(4) //ID of a attribute set named 'default'
        ->setTypeId('simple') //product type
        ->setCreatedAt(strtotime('now')) //product creation time
->setWeight(1.0000)
        ->setStatus(1) //product status (1 - enabled, 2 - disabled)
        ->setTaxClassId(0) //tax class (0 - none, 1 - default, 2 - taxable, 4 - shipping)
        ->setVisibility(Mage_Catalog_Model_Product_Visibility::VISIBILITY_BOTH) //catalog and search visibility
->setHasOptions(true);
    $product->save();

After this code I want to add the custom options to this added product. How can I do it? Any help would be greatly appreciated. Thankyou.


texts: is there any way When visitors try to add the products into shopping cart, they will be asked to login.?

texts: When visitors try to add the products into shopping cart, they will be asked to login first. Is that possible?


texts:
As i described in the title i don't get any results when i search for a product.
I have tried so far:

Checking the visibility of the products
My products are in stock
I have also set the qty to 100 to be sure
I have updated the products attributes under catalog->manage products-> select all products.
I assigned all the products in the main website for my certain store view.
The name attribute can be used for search.

I have also tried to search with the sku but nothing happens again.
The odd is that the advanced search with both name and skuworks.

And my problem remains.. Any ideas on how to make my products to appear when searched??


texts: Is it possible to run Elasticsearch and Magento on the same server?

texts:
Is it possible to run Elasticsearch and Magento on the same server or do I definitely need a second one?

I know that will depend on the shop but maybe someone can give a estimation.


texts:
We want the cheapest product to be free when 3 or more products in the same category added in the cart. See instance below:

Cart Items:
Qty: 2 - Prod 1 - Price: 20 - Total: 40 - Cat 1
Qty: 1 - Prod 2 - Price: 10 - Total: 10 - Cat 2
Qty: 5 - Prod 3 - Price: 10 - Total: 50 - Cat 1 <- cheapest

Total: $100

So we want to offer 1 quantity free to Prod 3 only since it's the cheapest item in the cart. So, we offer $10 discount based on Prod 3.

Is this possible with Magento Promotions?


texts: Magento compromised, second "PayPal Express Checkout" option added sending payment to unauthorized recipient

texts:
I had an order come in that wasn't followed by a PayPal payment, so I asked the customer if he had paid, and he sent me a screenshot of the receipt which shows the payment going to "Trust Website Payment", which of course is not me.

I did some digging around and noticed copies of order emails were going to "service@magentoservice.org", and payments were to be sent to "[myshopname]@yandex.com" (instead of @gmail.com).

I fixed all incorrect information, changed all my passwords, and updated to the latest version of Magento (I was at least one update behind). Next order came in without issue (except that I had to "authorize" the PayPal payment, which I've never had to do before), and then the order after that came in... once again no PayPal payment. This time the customer's receipt says payment went to "[a_variation_of_my_website_name] Payment", which is not, of course, me.

I did more digging and noticed a "PayPal Express Checkout" option added at the bottom of the Payment Solutions section that has the "Configure" option grayed out (see attached image). I suspect this is the culprit and last remnants of the security breach - but how do I remove it? Should I just do a total reinstall?

Thanks in advance


texts: TypeError: window.checkoutConfig.payment.instructions is undefined ( Magento2 )

texts: What could be missing from the payment method? Any Idea????


texts: Magento2: How product per page option working?

texts:
Issue:

Can any explain me regarding how the url is created on change of product per page option in magento2. You can check in image on change of limit the value is binded to url I want to know regarding working and creation of url.

Is there any solution to change url as per given requirement


texts: Create new row in Database when we click on button

texts:
By Default Magento create new row in Database in table sales_flat_quote_item_option once we click on ADD TO CART

We are giving an option of uploading custom image on Product image with help of custom module.

When we upload custom image on Product image [ link ] & click on Add to cart, we are saving custom image in Database in table sales_flat_quote_item_option & in column : value .

As like Add to cart button, we want same feature for one more custom button Save Design.

Save design button

<button id="submit-editorApply-{{rand}}" >Save Design</button>

i want to know which code is responsible for creating new row in Database after clicking Add to cart button.

Where i need to look in Module's Block or Controllers or Data or Helper or Model ?

I can just copy Add to cart code and just rename to "Save design", but once we click on "Save design", i don't want to add Product to cart , I just want to create new row in Database.


texts: Different style in Home and Category Pages

texts:
After I installed the Product Units and Quantities Extension, my Category Page just got a different "style". I tried to copy the catalog/category/view.phtml from a older backup but it doesn't changed anything. Another thing that is happening is that the AJAX Cart stopped working in category pages. It just redirect to /cart.

Beautiful Home Page:

Ugly Category Page:

Anyone knows how to fix it?
Thanks :)


texts: Cannot open catalog edit/add product after enabling developer mode

texts:
I'm using magento version 2.2.5, after i enabled the developer mode, i always get an error while trying to edit one of my product or add new in back end:

1 exception(s): Exception #0
(Magento\Framework\Config\Dom\ValidationException): Element
'arguments': Character content other than whitespace is not allowed
because the content type is 'element-only'. Line: 212
Exception #0 (Magento\Framework\Config\Dom\ValidationException):
Element 'arguments': Character content other than whitespace is not
allowed because the content type is 'element-only'. Line: 212
Exception #0 (Magento\Framework\Config\Dom\ValidationException):
Element 'arguments': Character content other than whitespace is not
allowed because the content type is 'element-only'. Line: 212
Element 'action': Character content other than whitespace is not
allowed because the content type is 'element-only'. Line: 226

i've successfully located the cause of the problem, which is in the extension i used, but i seems cannot find the problem:
<?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">
    <head>
        <link src="Company_Module::js/ver2.0.x/script.js"/>
    </head>
    <body>
        <referenceBlock name="product_tabs">
            <block class="Magento\Backend\Block\Widget\Tab" name="credit.price.settings">
                <arguments>
                    <argument name="label" xsi:type="string" translate="true">Credit Prices Settings</argument>
                    <argument name="url" xsi:type="helper" helper="Company\Module\Helper\Url::getUrl">
                        <param name="_current">0</param>
                    </argument>
                    <argument name="class" xsi:type="string">ajax</argument>
                    <argument name="group_code" xsi:type="string">basic</argument>
                </arguments>
            </block>
            <action method="addTab">
                <argument name="name" xsi:type="string">credit-price-settings</argument>
                <argument name="block" xsi:type="string">credit.price.settings</argument>
            </action>
        </referenceBlock>
    </body>
</page>


texts: Implementing 3D Secure verification in Custom API based payment method in magento

texts:
I am working on custom API based payment gateway. For 3D secure verification payment gateway return encoded form that need to submit to redirect user on third party site for card verification.

I am working on this code  in capture function of payment model.

Here My question is How can I use encoded form to redirect user from payment model  capture method to third party site.

I have used getOrderPlaceRedirectUrl to redirect user in Hosted form Method.

Please suggest.


texts: Import Csv File for product and for product gallery image

texts: I need to import the product using csv file and also need to import the images for product gallery.


texts: Can i make the special price override the catalog price rules?

texts: Is it possible to override the catalog price rules with the special price?


texts: Magento 2 CSS .less files with @variables

texts:
I'm having trouble changing the max-width of a theme in Magento 2.

I've found the CSS in:

<THEME>/web/css/source/_layout.less

max-width: @layout__max-width;

Then in the Magento Lib folder there is documentation for the variable:

@layout__max-width
Default: 1280px
Allowed Values: '' | false | value
Comment: Page maximum width

So i tried adding a new definition to my _layout.less file

@layout__max-width:1185px;

Also tried adding the same definition to _theme.less file

But i'm still getting max-width of 1280px

Any ideas what i've done wrong would be greatly appreciated

Thanks


texts: Magento 2 : Access image from Module's block

texts:
I want to access image from a Block in my custom module.  This is my current code:

public function getCustomtxt()
{
   $block->getViewFileUrl('images/Phone.jpg');
}


texts: Magento Module not loading. Codepool local

texts:
I am trying to make a module to hide product types when tryng to create a new product.

I have created the files as follows:

app\etc\modules\Grando_Producttype.xml

<?xml version="1.0"?>
<Grando_Producttype>
        <active>true</active>
        <codePool>local</codePool>
</Grando_Producttype>

app\code\local\Grando\Producttype\etc\config.xml

<?xml version="1.0"?>
<config>
    <modules>
        <Grando_Producttype>
            <version>1.0</version>
        </Grando_Producttype>
    </modules>
    <global>
        <models>
            <catalog>
                <rewrite>
                    <product_type>Grando_Producttype_Model_Product_Type</product_type>
                </rewrite>
            </catalog>
        </models>
    </global>
</config>

app\code\local\Grando\Producttype\Model\Product\Type.php

<?php
class Grando_Producttype_Model_Product_Type extends Mage_Catalog_Model_Product_Type
{
    static public function getOptionArray()
{
    $options = array();
    foreach(self::getTypes() as $typeId=>$type) {
        if($typeId == 'virtual'):
            $options[$typeId] = Mage::helper('catalog')->__($type['label']);
        endif;
    }

    return $options;
}
}

This should be working good I think, but for some reason it is not loading and all products still show up and I have no idea why and can't find the reason.
I am quite new to Magento. Is there any configuration I might be missing?
I've already tryed to change my class name to Grando_Producttype_Model_Product_Type and no success...

Cache is not activated,

Any help will be appreciated! Thanks


texts: Search results block showing twice - how to customize via layout local.xml

texts:
I need to add a custom nested block to the products.list block for category and search pages. For category, there's no issue unsetting category.products then redefining the block with my custom block included. However, for search, the same approach doesn't appear to work - I get two search.result blocks rendered even after unsetting it. It's highly possibly I'm missing something obvious here but can't see it. My xml definition in local.xml is as follows:

<catalogsearch_result_index>
        <reference name="root">
            <action method="setTemplate"><template>page/category.phtml</template></action>
        </reference>
        <reference name="content">
            <action method="unsetChild">
                <name>search.result</name>
            </action>
            <block type="catalogsearch/result" name="search.result" template="catalogsearch/result.phtml">
                <block type="catalog/product_list" name="search_result_list" template="catalog/product/list.phtml">
                    <block type="review_blocks/reviews_product_list" name="reviews" template="reviews/product/list.phtml"/>
                </block>
            </block>
        </reference>
    </catalogsearch_result_index>

Any advice appreciated !

EDIT:

So what I'm doing in the category default layout handle, which works, is as follows:

<catalog_category_default>
        <reference name="content">
            <action method="unsetChild">
                <name>category.products</name>
            </action>
            <block type="catalog/category_view" name="category.products" template="catalog/category/view.phtml">
                <block type="catalog/product_list" name="product_list" template="catalog/product/list.phtml">
                    <block type="review_blocks/reviews_product_list" name="reviews" template="reviews/product/list.phtml"/>
                </block>
            </block>
        </reference>
    </catalog_category_default>

Within list.phtml, I want to output the reviews for each product via:

<?php echo $this->getChild('reviews')->setProduct($_product)->toHtml() ?>

However, if I try as Marius suggested to do, I can't access my child block and get a fatal error with the above setProduct method :


texts: It was okay the other day. Magento is pointing to the correct style-sheet. I have made changes to it which were successfully uploaded but when I do a code inspect element, the file doesnt show the changes. However if I go through the file manager in my Plesk, the changes I made do show?!


texts: Load Mage_Sales_Model_Quote_Address usign Ajax

texts:
To add a discount amount to cart total, I am using function collect() and fetch().

Namespace_Module_Model_Sales_Quote_Address_Total_Module Mage_Sales_Model_Quote_Address_Total_Abstract{

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

            $this->_setAmount(0);
            $this->_setBaseAmount(0);

            $items = $this->_getAddressItems($address);
            if (!count($items)) {
                return $this; //this makes only address type shipping to come through
            }

    public function fetch(Mage_Sales_Model_Quote_Address $address)
        {
            $amt = $address->getDiscountAmount();

I am using ajax to load the cart total block and show discount amount. The issue is, it displays the discount amount text and function fetch() is used for display purposes. but the cart total deductions are not happening as function collect() is not being called in ajax.

Is it possible to perform same operations in my controller that is being performed in Mage_Sales_Model_Quote_Address ?

If I reload the page, I can see the applied discount and proper deductions but not on ajax click.

Please Help.


texts: redirect nor working -> overwriting all the time

texts:
I did a redirect as I saw this http://www.templatemonster.com/help/magento-adding-page-links-in-the-navigation-bar.html

It worked fine, until we added new products. Now the redirect is not here anymore as I defined, it is the "old" redirect here instead.

How I can prevent this overwriting?


texts: How to reduced Minicart DropdownDialog widget width

texts: I am using the DropdownDialog widget for my custom dropdown, if i click the DropdownDialog widget width is more compare to docs, how to reduced the width,


texts:
I have a category created which contains url key as - "sofa" and url generated is "sofa.html". URL rewrites system record generated as follows :

ID Path : category/5
Request path : sofa.html
Target Path : catalog/category/view/id/5

Now I want to run one of the custom module over that url(sofa.html) so I deleted system url rewrites and added custom url rewrites from the backend as follows :

ID path : alternate-sofa
Request path : sofa.html
Target path : alternate-sofa

So when I run sofa.html from the browser, I got the expected page from the custom module and it resolves the issue removing custom rewrites after reindexing, though after reindexing new system record added as follows :

ID path : category/5
Request path : sofa-1.html
Target path : catalog/category/view/id/5

Now, I am having issue as follows : On the page, I am listing out categories on left side which contains category url as "sofa-1.html" which is displaying my category layout instead of custom module. How to overcome this issue? I don't want to create sofa-1.html, sofa-2.html, onwards.

Edit :
I refereed http://jc-designs.net/blog/2012/09/magento-adding-cms-pages-to-the-main-navigation/ and http://www.magentocommerce.com/knowledge-base/entry/adding-page-links-in-the-navigation-bar but when I set 301(permenant), url changed from "sofa.html" to "alternate-sofa" which is not expected url in the browser.


texts: Dynamically hide header/footer for a static page

texts:
I have some static pages on the site which will be rendered on mobile site as well. I will be serving these pages from the desktop application. To make it mobile design friendly, I need to hide the header and footer from the pages. These pages are cms pages, product pages etc..I can have the mobile pass some parameter in the URL to identify the referrer(cant use server referrer variable). example.com/comingfrom/mobile/privacypolicy.html.

From admin I tried adding

<remove name="header" />
<remove name="footer" />

under custom layout update xml and it worked fine but this removes header/footer forever. Where in the code I need to place this information? Which layout file to update? Thanks!


texts: Magento 1.9 When is inventory subtracted and where to edit it in code?

texts: In Magento, when an order is successful placed. The item will be subtracted from the stock. I want to know when is this happened, and if I want to edit the logic to this, which file should I look at?


texts: tabs with grids in an admin extension that is not a form

texts:
I have been searching for an example of how to write an extension page with tabs and on each tab is a grid.  I don't need a form, just the mass action too.  Any one have a link to this?  What I'm doing is converting something I have which is under /myext/mycontrol/index/ which I would like to keep and not end up with /admin/mycontrol/index.

An example would be ideal, but if someone can layout the files, for two tabs with grids and the classes, that would be enough I know it.  Here is what I have so far for the blocks and controllers.

+-Block
|+-Mycontrol.php
|+-Mycontrol
| |+-Tabs.php
| |+-Action1.php
| |+-Action1
|   |+-Grid.php
+-controllers
 |+-MycontrolController.php

I see the page but no tabs.  Here are the file stubs with out the method, as I'm sure that is the issue at hand here.

admin\Mycomp\Myext\Block\Mycontrol.php

<?php
class Mycomp_Myext_Block_Mycontrol extends Mage_Adminhtml_Block_Widget_Grid
    implements Mage_Adminhtml_Block_Widget_Tab_Interface {

    public function __construct() {
        $this->_blockGroup = 'mycontrol';
        $this->_controller = 'media';
        $this->_headerText = Mage::helper('myext')->__('Welcome');
        parent::__construct();
    }

}

admin\Mycomp\Myext\Block\Mycontrol\Tabs.php

<?php
class Mycomp_Myext_Block_Mycontrol_Tabs extends Mage_Adminhtml_Block_Widget_Tabs {
    public function __construct(){
        parent::__construct();
        $this->setId('myext_tabs');
        $this->setTitle(Mage::helper('myext')->__('media controll'));
    }
    protected function _beforeToHtml(){
        $activeSection = $this->_getActiveSection();
        //normal stuff
        return parent::_beforeToHtml();
    }

    protected function _getActiveSection($default = 'orphaned'){
        //normal stuff
        return $activeSection;
    }
}

admin\Mycomp\Myext\Block\Mycontrol\Action1.php

class Mycomp_Myext_Block_Mycontrol_Action1 extends Mage_Adminhtml_Block_Widget_Grid_Container{
    public function __construct(){
        $this->_controller = 'mycontrol_action1';
        $this->_blockGroup = 'mycomp_myext';
        $this->_headerText = Mage::helper('myext')->__('Find Orphaned Images');
        parent::__construct();
        $this->_removeButton('add');
    }

    public function getCreateUrl() {
        return '';
    }

    public function getHeaderCssClass() {
        return '';
    }
}

admin\Mycomp\Myext\Block\Mycontrol\Action1\Grid.php

<?php

class Mycomp_Myext_Block_Mycontrol_Action1_Grid extends Mage_Adminhtml_Block_Widget_Grid {
    public function __construct()
    {
        parent::__construct();
        $this->setId('mycontrol_action1Grid');
        $this->setDefaultSort('prod_id');
        $this->setDefaultDir('ASC');
        $this->setSaveParametersInSession(true);
        $this->setUseAjax(true);
    }

    public function getId(){
        return 'myext_tabs_action1_section_content';
    }

    protected function _prepareCollection(){
        //normal stuff
        return parent::_prepareCollection();
    }

    protected function _prepareColumns(){
        //normal stuff
        return parent::_prepareColumns();
    }

    protected function _prepareMassaction(){
        //normal stuff
        return $this;
    }
}

Something tells me it's just in this order I'm messing up, but for the life of me I can't find one darn example that is not talking about adding tabs to the product page or tabs, edit, and forms.  Can some one lay it out?

Update
I have been trying different ways to make this happen.  Googling has not help.  I do recall some wiki that had an example of on the magento site but I can't find that either.  If anyone has the ability, a layout of the files needed and the classes is all I need.  A good point in the right direction.

As I understand, I should be close, and tried (I can't seem to find the reference now but something like) $this->add_left() but that was not working either.