texts: No Way to Clear/delete a Selected Image using Media Browser on category edit page

texts:
With reference to this Q&A there's another question.

How do I clear the image selected using the Media Browser on category edit page in the admin Panel?

Here's what I tried:

  in app/code/Vendor/Module/view/base/web/template/form/element/custom-button.html

I added an extra button which will clear the value of the hidden input field, when clicked.

But the real problem starts here. When the Category is saved (Save button is clicked), the Knockout JS observables, replace the already saved value or newly selected value (image url) to the input field.

  ref: vendor/magento/magento2-base/lib/web/knockoutjs/knockout.js line 1276

function observable() {
    if (arguments.length > 0) {
        // Write

        // Ignore writes if the value hasn't changed
        if (observable.isDifferent(_latestValue, arguments[0])) {
            observable.valueWillMutate();
            _latestValue = arguments[0];
            if (DEBUG) observable._latestValue = _latestValue;
            observable.valueHasMutated();
        }
        return this; // Permits chained assignments
    }
    else {
        // Read
        ko.dependencyDetection.registerDependency(observable); // The caller only needs to be notified of changes if they did a "read" operation
        return _latestValue;
    }
}

now I used the component property in the category_form.xml to override this behaviour, but unsuccessful.

    <field name="custom_attribute_code">
         <argument name="data" xsi:type="array">
            <item name="config" xsi:type="array">
                <item name="sortOrder" xsi:type="number">40</item>
                <item name="formElement" xsi:type="string">input</item>
                <!--<item name="notice" xsi:type="string">The categroy has to be saved after selecting an image</item>-->
                <item name="elementTmpl" xsi:type="string">Vendor_Module/form/element/bg-button</item>
                <item name="elementId" xsi:type="string">custom_attribute_code</item>
                <item name="dialogUrl" xsi:type="url" path="cms/wysiwyg_images/index">
                    <param name="target_element_id">custom_attribute_code</param>
                    <param name="type">file</param>
                </item>
                <item name="component" xsi:type="string">Vendor_Module/js/form/element/button</item>
                <item name="label" xsi:type="string" translate="true">Custom Attribute Label</item>
            </item>
        </argument>
    </field>

[only that line]

<item name="component" xsi:type="string">Vendor_Module/js/form/element/button</item>

where button.js is in the following path

  Vendor/Module/view/base/web/js/form/element/button.js

But I get the following error.

TypeError: Constr is not a constructor                      layout.js (line 66, col 25)

Can someone show me the right direction on how do I override the above mention Knockout JS observable with my js file???


texts: How to remove Sort By Name from Magento product listing page?

texts:
I want to remove Sort by Name in Listing page Filter option.

Please Suggest me.


texts: Set created_at when programatically creating a Magento order

texts:
I'm struggling to set the order date when creating a magento order programatically.

Here is what I'm trying to use:

$orderObj->setData('created_at', $date);
$orderObj->setUpdatedAt($date);

but it doesn't appear to work.

Thank you in advance!


texts: Configurable product tax class from simple product

texts:
We have a problem with configurable products and UK VAT, we need to be able to apply 0% tax on children sizes and the standard 20% tax on adult sizes but configurable products do not respect the tax class id set on the simple products used.

I checked out the BCP module but that does not handle this unfortunately.

I think a custom module is required that bypasses the configurable products tax class and instead grabs the tax class id of the simple product that has been selected.

Having not had to deal with Magento core very much I have tried to find a way to over-ride the tax class id used but so far no luck, would some body be able to point me in the right direction or better still if I've missed another solution to this?


texts: setup:static-content:deploy need to run for minor php changes?

texts:
Why do i need to run php bin/magento setup:static-content:deploy each time i clear the cache and also running the same command is time consuming.

I enabled apache rewrite! But still why ?


texts:
I need to redirect my magento to another domain after changing the language.
Example:

After select English - switch domain to mydomain.co.uk

After select Czech Republic - switch domain to mydomain.cz

Anyone know how to do ?
@Prince
Can you explain me more ? I have two languages set up and a working store switcher.
When I switch language then I get url:
From EN to CZ:
http://myweb.com/?___store=cz&___from_store=en

FROM CZ TO EN:
http://myweb.com/?___store=en&___from_store=cz

only now instead:
http://myweb.com/?___store=cz&___from_store=en

I want redirect:
http://myweb.cz/

EDIT2:
I have created new website_Cz:

and set language cz for new website
but now I cannot see this language on frontend switcher.

I know I'm still doing it wrong, I will be grateful if you can help me solve this problem.


texts: RWD - Best way to put related products in the tabs section?

texts:
Whats the best way to put the related products in the tab section and make them horizontal?

Thanks


texts: Magento WYSOWYG "Insert Image" Displays Blank Page After URL Update

texts: I have a issue with magento 1.9.2.2. Today we updated the "base URL" to display the "www" part of our url at the store in addition to updating the haccess file to. Orginally it was just https://domainname.com. Now we have setup to display like this: https://www.domainname.com. Since then there are some icons that wont display throughout the backend and the today I tried adding a new image to the static block section and I only get a blank page when I go to insert a image into the editor. In addition to this I uploaded to free imaging hosting site and inserted the url directly and it reverts back. I dont think something updated all the way but not sure what it could be. Anyone experience this issue?


texts: How should I add Hindi language pack in Magento1.9 community edition? Or it need to create

texts:
I want to add the Hindi as language for store view which is local language in India.

Please can anyone suggest me how should i proceed.


texts: In checkout page Shipping Address and Shipping method title want to make in toggle

texts:
Where to add this jQuery code to make checkout page in shipping title and shipping method toggle.

        $('.step-title').on("click",function(){
            $(this).parent().find('#checkout-step-shipping_method').toggle();
        })

        $('#shipping .step-title').on('click',function(){
            $(this).parent().find('#checkout-step-shipping').toggle()
        })
        $('#checkout-step-shipping').css("display","none");
        $('#checkout-step-shipping_method').css("display","none");

Thanks.


texts: Today I remove some product in my magento site. But when I check my media directory I see there images are exist. Now I need when I remove any product then remove all images which assign with that product.


texts: Add to cart not working in custom template magento2

texts:
I am getting add to cart url by product object like below.

Block file.

 use Magento\Catalog\Api\ProductRepositoryInterface;
 use \Magento\Checkout\Helper\Cart as CartHelper;
 class CustomAdd extends \Magento\Framework\View\Element\Template
  {
   protected $_productRepository;
   protected $cartHelper;
   public function __construct(
      ProductRepositoryInterface $productRepository,
      )
     {
      $this->_productRepository = $productRepository;
       $this->cartHelper = $cartHelper;
     }

   public function getAddToCartUrlForProduct($productSku)
   {
     $product = $this->_productRepository->get($productSku);
     return $this->cartHelper->getAddUrl($product);
   }
 }

Using like below in template

   <?php
    $addtoCartUrl = $block->getAddToCartUrlForProduct(11101);
   ?>

<a href="<?php echo $addtoCartUrl; ?>" class="btn-addtocart">Add to Cart

This is not adding the product to cart. can anyone please suggest me . Where i am wrong here. Thanks


texts: The block is not displaying after loading the page

texts:
Please help solve this puzzle.
I'm created after plugin, after load category widget. The collection of items must be used in the js. The idea is to simply intercept the collection in the plugin, load it to the front in the .phtml template and process it in it. My plugin code
ParceWidget.php
namespace Vendor\Module\Plugin;

use Magento\Framework\View\Element\Template;

class ParceWidget
{
    protected $blockFactory;

    public function __construct(
        \Magento\Framework\View\Element\BlockFactory $blockFactory
    ) {
        $this->blockFactory = $blockFactory;
    }

    public function afterCreateCollection(
        \Magento\CatalogWidget\Block\Product\ProductsList $subject,
        $itemsCollection
    ) {
        $this->parceWidgetInformation($itemsCollection);

        return $itemsCollection;
    }

    protected function parceWidgetInformation($itemsCollection)
    {
        $block = $this->blockFactory->createBlock(
            Template::class,
            [
                'data' => [
                    'widget_items' => $itemsCollection
                ]
            ]
        )
            ->setTemplate('Vendor_Module::widget.phtml');

        $block->setNameInLayout('vendor.module.widget');
        $block->toHtml();
    }
}

widget.phtml

    <?php if ($items = $this->getData('widget_items')):?>
        <?php //var_dump($items); die();?>
        <?php foreach ($items as $item): ?>

<?= $item->getData()?>

        <?php endforeach;?>
    <?php endif;?>

I have omitted some of the standard points, leaving the gist.
So, if you write any content in widget.phtml, then at the end of loading the page on the front will not be displayed. But if you stop the download page process by doing for example:
<?php var_dump($items')); die();?>
In this case, everything will be in place. Here I have a question, where does the data disappear in the process of loading the page, because you can see that the template is loaded and the data can be obtained in it?


texts: Convert Order Address into customer Address

texts:
Under a sales_order_place_after event Observer, I try I save a guest customer and I try to save the order Adresses into the guest customer Adresses:

I get the the Billing and Shipping Adresses like this:

$order = $observer->getEvent()->getOrder();
$billingAddress = $order->getBillingAddress();
$shippingAddress = $order->getShippingAddress();

And I want to save them to the guest customer.

How can I do it ?

Thanks a lot.


texts:
I have created a custom theme and added Magento_Checkout, Magento_Theme, Magento_Catalog and Magento_OfflinePayments into it and edited some view files and both the Magento_Checkout & Magento_Theme working perfectly. I can add new files into it or edit and can see the result on the frontend but the other 2 Catalog and Offline Payments not working or getting picked up.

I checked in the view_preprocessed and can see Magento_Checkout, Magento_Theme been created but missing the other two

I run index, cache, setup upgrade, compile, deleted static content redeployed it etc

Would anyone tell me what am I doing wrong


texts:
I want to translate terms from various magento modules for a custom-theme (based un Luma).

What I've been doing:

Created a list of translation terms app/design/frontend/vendor/theme/i18n/de_DE.csv looking like this:

"Search entire store here...",
Produktsuche",module,Magento_Search
"Sort By",Sortieren,module,Magento_Catalog
"Shop By",Filter,module,Magento_Catalog

Then I tried various commands but all fail to deploy the translation finally to my development shop:

magento i18n:pack /path/to/csv de_DE

Does something, but I don't know what. I says Successfully saved de_DE language package. but not telling the secret of where to.
Also I ran

magento setup:static-content:deploy de_DE

Wich results in:

[Magento\Framework\Exception\LocalizedException]
NOTE: Manual static content deployment is not required in "default" and "developer" modes.
In "default" and "developer" modes static contents are being deployed automatically on demand.
If you still want to deploy in these modes, use -f option: 'bin/magento setup:static-content:deploy -f'

Running

magento setup:upgrade

Not showing any results.
I also failed to find a good guideline explaining how to translate module based terms on a theme basis.

Can someone point out how to translate module strings to another language on a theme basis


texts: Is it possible to iterate over Magento collections with pagination natively?

texts:
What I mean by that is - is there a way to do:

$collection = $model->getCollection();
foreach ($collection as $item) {
    $item->doStuff();
}

In such a way that even if the collection had 100k rows, it would only load a page of rows at a time from MySQL and magically paginate them for you behind the scenes.

From looking at Varien_Data_Collection_Db::load() it doesn't seem like it's possible, but just wanted to check.  This seems like something that should be a common need.


texts: Welcome Email 1.9 disable sending this email

texts:
I have tried the other answers but have been unsuccessful. I am fairly new to PHP, XML, OOP, and Magento, sorry about that...

I would like to disable the "Welcome new customer email" that is sent when a new client has created a new account, that is the only scenario I wish to disable.

can you please tell me:

The name and address of the file or files.
Location of the snippet or snippets to change in the file
(line number or surrounding code)
What is happening when I change it.
What is it I am changing ( function , property , object, ...)
One great Magento newbi help tip. ;-)

Is the  sendNewAccountEmail() being triggered from both a Global and Local variable? almost like a fail safe?

Thank you so much for your time, professional help and advice.
dond223


texts: What is the difference between order id, increment id and quote id?

texts:
I observed that all the above term's value are different which I thought to be same.

echo $orderId = $observer->getEvent()->getOrderIds();
echo $qid = $order->getQuoteId();
$order_data= $order->getData();
echo $increment_id = $order_data['increment_id'];

Above code outputs orderId: 32, QuoteId: 41 and incremenId: 52. Why are these three values different and what they mean?


texts: Products are not visible in front end in magento 2.2 and how to make it to visible in front end?

texts:
I have installed Magento 2.2 and have created new products in admin end.
Those products are saved in DB, but it is failed to display in the store front.
If I created configurable product, after saving  it automatically changed to virtual product.
Please solve my issue.


texts: Magento 2 REST API - Encrypted Authentication

texts:
I would know if it is possible to use the REST API of Magento using a Basic Auth approch.

The idea of the token authentication, as described in the doc is very simple and good for my purpose but for a security reason I couldn't send in the payload the information not encrypted (imagine that there is a subagent  in the communication that receives this payload and use it to authenticate the user )

So, there is a method to make the authentication to the endpoint, but using Base64 BasicAuth?

For example :

Endpoint
POST http://<host>/rest/default/V1/integration/customer/token

Headers
Content-Type application/json

Data:
{
"credentials": "BASE64(admin:123123q)",
}


texts: Want to display price in configurable products each options in magento 2

texts:
I want to display configurable products associated simple product price in configurable product option.

I am attaching image as price display below the option value. If some one has did this task then help me.


texts: Magento 1.7.0.2 - cannot install SUPEE 2629 (PHP 5.4 patch)

texts:
I have downloaded fresh copy of Magento 1.7.0.2 and PHP 5.4 patch for 1.7.0.2 version, problem is I can't install patch via SSH, working with Magento on local disk! I have found similar problems, other people had HUNK fail problem, my problem is somewhat different, as shown on picture, tried with "sh" and "bash" commands, same problem.

For SSH client, I'm using MobaXterm, not sure if that is relevant. I'm new in coding, maybe I'm doing something wrong.

UPDATE: I have installed Cygwin, started the Cygwin shell and tried to execute patch and then it shows

  Error! Some required system tools, that are utilizied in this sh script, are not installed: Tool(s) 'patch' is(are) missed, please install it(them).

I searched on Cygwin page, under Cygwin Package Search, and for 'patch' it finds 2546 matches. What now?

UPDATE: It worked, thank you! I have replied today because once everything has been installed (including 9 security patches), forgot to post update, I tried to upvote the answer but it didn't accept, probably because of reputation not being high enough! Anyway, thanks again fschmengler!


texts:
Can anyone help me to resolve this error on my magento website?

There has been an error processing your request

  SQLSTATE[HY000]: General error: 1 Can't create/write to file
  '/tmp/#sql_27a0_0.MYI' (Errcode: 28 - No space left on device)

I have a dedicated server with Godaddy with 1TB of space.

My site is inaccessible.


texts: Getting error when show "out of stock" products in last

texts:
I have developed Magento module that shows out of stock products in last of catalog page list and I test it in my test website and it works correctly but in other websites (Magento 1.9.3.7) I got following error

  ERROR : a:5:{i:0;s:64:"You cannot define a correlation name 'sorting_t1' more than once";i:1;s:6125:"#0 /home/resellern/domains/mysite.com/public_html/lib/Varien/Db/Select.php(281): Zend_Db_Select->_join('left join', Array, 'e.entity_id=sor...', Array, NULL)

  1 /home/resellern/domains/mysite.com/public_html/app/code/core/Zend/Db/Select.php(373):
  Varien_Db_Select->_join('left join', Array, 'e.entity_id=sor...',
  Array, NULL)

  2  /home/resellern/domains/mysite.com/public_html/app/code/core/Mage/Eav/Model/Entity/Attribute/Source/Table.php(122):
  Zend_Db_Select->joinLeft(Array, 'e.entity_id=sor...', Array)

  3  /home/resellern/domains/mysite.com/public_html/app/code/core/Mage/Catalog/Model/Resource/Product/Collection.php(1595):#2#3

and this is my code that run in observrer.php

 $toolbar = Mage::getBlockSingleton('catalog/product_list_toolbar');
    if ($toolbar) {
        $products = $observer->getEvent()->getCollection();

        $stockId = Mage_CatalogInventory_Model_Stock::DEFAULT_STOCK_ID;
        $websiteId = Mage::app()->getStore($products->getStoreId())->getWebsiteId();

        $products->getSelect()->joinLeft(
            array('_inv' => $products->getResource()->getTable('cataloginventory/stock_status')),
            "_inv.product_id = e.entity_id and _inv.website_id=$websiteId and _inv.stock_id=$stockId",
            array('stock_status')
        );
        $products->addExpressionAttributeToSelect('in_stock', 'IFNULL(_inv.stock_status,0)', array());

        $products->getSelect()->reset('order');
        $products->getSelect()->order('in_stock DESC');

        if ($toolbar->getCurrentOrder()) {
            $products->addAttributeToSort($toolbar->getCurrentOrder(), $toolbar->getCurrentDirection());
        }
    }

    return $this;

I say again this code work in my test and other websites but it doesn't work in the specific website and got an error.


texts: Add category tree with checkboxes to the form

texts:
Is there any way to add a category tree with checkboxes to a form in the admin part?

The form contains two other fieldsets, and the category tree must be added as the third fieldset. All information that I have found was how to add a category tree separately, without injecting it in existing form. But here I need to render a block inside another block, or something like this.

I am curious how can I achieve this.


texts: How do I add the catalog/navigation block or am I just lost?

texts:
I am working on Magento 1.9.2.4 using a Porto theme. I am trying to get my sub category listing block working so it shows the sub category on the parent category page. The links are showing and working but no images. I read a previous thread to add the catalog/navigation block under permissions and allow it. But I don't even show is in my list of available blocks. What am I missing? :(

http://market.matthewsenvironmentalsolutions.com/index.php/cremator-parts.html

Thank you so much - any help would be greatly appreciated!


texts: How can I get all information about order?

texts:
How I tried this:

error_reporting( E_ALL );
require_once "lib/nusoap.php";
require_once "../app/Mage.php";
Mage::app('admin');
try {
    $order = Mage::getModel('sales/order')->loadByIncrementId('242647');
    print_r($order->debug());
} catch (Exception $e) {
    echo 'Caught exception: ',  $e->getMessage(), "\n";
}

but it does not seem to work.
No errors, nothing.

I change a bit my approach and now it looks like:

include('./app/Mage.php');
Mage::app();
$mage_php_url = '../app/Mage.php';

$OrderNumber = "242647";//My Order Number here
$order = Mage::getModel('sales/order')->load($OrderNumber, 'increment_id');
$orderId = $order->getData('order_id');
print($orderId);

$order->getAllVisibleItems();
$orderItems = $order->getItemsCollection()
    ->addAttributeToSelect('*')
    ->addAttributeToFilter('product_type', array('eq'=>'simple'))
    ->load();

foreach($orderItems as $sItem) {

if($sItem->getProductType() == "simple")
{
    echo "\n*********************************\nMage Order #: ".$OrderNumber."\n";
    //Simple Item Info from Order
    echo "Type: ".$sItem->getProductType()."\n";
    echo "Order Id: ".$sItem->getOrderId()."\n";
    echo "Product Id: ".$sItem->getProductId()."\n";
    echo "Item Id: ".$sItem->getId()."\n";
    echo "Item Name: ".$sItem->getName()."\n";
    echo "Item Sku: ".$sItem->getSku()."\n";
    echo "Item Price: ".$sItem->getPrice()."\n";

    $pItemId = $sItem->getParentItemId();
    echo "Parent Item Id: ".$pItemId."\n";

    echo "\n*****\n";

    //Get Parent Item Information
$item = Mage::getModel('sales/order_item')->load("$pItemId"); //use an item_id here
    //Testing, want to see whats inside the parent/configurable item?
    print_r($item->toArray());

    echo "Parent Type: ".$item->getProductType()."\n";
    echo "Parent Order Id: ".$item->getOrderId()."\n";
    echo "Product Id: ".$item->getProductId()."\n";
    echo "Item Id: ".$item->getId()."\n";
    echo "Parent Item Price: ".$item->getPrice()."\n";
    echo "Qty: ".$qty = intval($item->getQtyOrdered())."\n";

    //get Active Product Data
    $nProduct = Mage::getModel('catalog/product')->load($sItem->getProductId());
    $nSku = $nProduct->getSku();
echo "new Product UPC:".$nUpc = $nProduct->getUpc() . "\n";
    echo "new Product Price:".$nPrice = $nProduct->getPrice(). "\n";

    }
}

but still nothing ;)


texts: Magento 1.9 - How to assign all products in a sub categories to it's parent categories?

texts:
My products assigned as sub categories and child categories, how to assign all products in a category to it's parent categories.

eg:

Books/Children/Boys, Now the products assigned with Boys child category, how to assign parent category Books.


texts: I have recently installed this (module). There is no documentation(how to install, how to use etc). So i copied the files manually(didnt use magento connect), clear the caches, logged out and re -login from admin and nothing happened. I checked in the configuration/advanced and it is enabled. I also checked the system.log files (it is empty). So my question : is there a method to check if my module is working or not ? How do I test it ?


texts:
[M1]

I have a magento store and we have different stores for each country. We have 6 websites:

au.mydomain.com
us.mydomain.com uk.mydomain.com uae.mydomain.com    in.mydomain.com ca.mydomain.com

Problem is, each website has the same categories, product, and even the content. The only difference is the pricing & currency. I'm quite sure this would create a duplicate content issue and would lessen our chances of ranking on Google. I guess we are already facing the issue because we rank nowhere till 10 pages of Google Search.

What's your best recommendation for SEO in such a case? We would like to rank with different domains in different countries, for example, we want to rank on google.com.au with our au.mydomain.com & on google.co.uk with uk.mydomain.com


texts: magento 1.5.0.1 upload image button doesn't display

texts:
I am using magento 1.5.0.1

My problem is i want to upload an image,but upload image and browse image buttons are not displaying.


texts: Error:Exception:Use of undefined constant ICONV_IMPL - assumed 'ICONV_IMPL'

texts:
Now the site doesn't show and we get the following Error on the home page

Exception: Notice: Use of undefined constant ICONV_IMPL - assumed
'ICONV_IMPL' in
/home/tassosco/public_html/vendor/magento/framework/Stdlib/StringUtils.php
on line 162 in
/home/tassosco/public_html/vendor/magento/framework/App/ErrorHandler.php:61
Stack trace: #0
/home/tassosco/public_html/vendor/magento/framework/Stdlib/StringUtils.php(162):
Magento\Framework\App\ErrorHandler->handler(8, 'Use of undefine...',
'/home/tassosco/...', 162, Array) #1
/home/tassosco/public_html/vendor/magento/framework/HTTP/Header.php(120):
Magento\Framework\Stdlib\StringUtils->cleanString('Mozilla/5.0
(X1...') #2
/home/tassosco/public_html/vendor/magento/framework/HTTP/Header.php(57):
Magento\Framework\HTTP\Header->_getHttpCleanValue('HTTP_USER_AGENT',
true) #3
/home/tassosco/public_html/vendor/magento/framework/App/Response/HeaderProvider/XssProtection.php(43):
Magento\Framework\HTTP\Header->getHttpUserAgent() #4
/home/tassosco/public_html/vendor/magento/framework/App/Response/HeaderManager.php(42):
Magento\Framework\App\Response\HeaderProvider\XssProtection->getValue()
5 /home/tassosco/public_html/vendor/magento/framework/Interception/Interceptor.php(123):
Magento\Framework\App\Response\HeaderManager->beforeSendResponse(Object(Magento\Framework\App\Response\Http\Interceptor))
6 /home/tassosco/public_html/var/generation/Magento/Framework/App/Response/Http/Interceptor.php(117):
Magento\Framework\App\Response\Http\Interceptor->___callPlugins('sendResponse',
Array, Array) #7
/home/tassosco/public_html/vendor/magento/framework/App/Http.php(185):
Magento\Framework\App\Response\Http\Interceptor->sendResponse() #8
/home/tassosco/public_html/vendor/magento/framework/App/Http.php(156):
Magento\Framework\App\Http->handleDeveloperMode(Object(Magento\Framework\App\Bootstrap),
Object(Exception)) #9
/home/tassosco/public_html/vendor/magento/framework/App/Bootstrap.php(263):
Magento\Framework\App\Http->catchException(Object(Magento\Framework\App\Bootstrap),
Object(Exception)) #10 /home/tassosco/public_html/index.php(39):
Magento\Framework\App\Bootstrap->run(Object(Magento\Framework\App\Http))
11 {main}

please help me?


texts: Magento 2: Templates are not working correctly

texts:
I'm attempting to create my own module with a custom template however in my browser, I am unable to view the 'hello world' output.

Gregt/Hello/block - helloworld.php

    <?php
    namespace GregT\Hello\Block;

    class Helloworld extends \Magento\Framework\View\Element\Template
    {
    public function getHelloWorldTxt()
    {
        return 'Hello world!';
       }
    }

Gregt/Hello/controller/index - index.php

    <?php

    namespace GregT\Hello\Controller\Index;

    use Magento\Framework\App\Action\Context;

    class Index extends \Magento\Framework\App\Action\Action
    {
     protected $_resultPageFactory;

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

    public function execute()
    {
        $resultPage = $this->_resultPageFactory->create();
        echo ("hello");
        return $resultPage;
       }
    }

Gregt/Hello/VIEW/frontend/layout - helloworld_index_index.xml

    <page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"

    xsi:noNamespaceSchemaLocation="../../../../../../../lib/internal/Magento/
    Framewo rk/View/Layout/etc/page_configuration.xsd" layout="1column">

        <referenceContainer name="content">
            <block class="GregT\Hello\Block\Helloworld" name="helloworld"
    template="GregT_Hello::helloworld.phtml" />
        </referenceContainer>

    </page>

Gregt/Hello/etc/frontend - routes.xml

    <?xml version="1.0"?>

    <config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xsi:noNamespaceSchemaLocation="urn:magento:framework:App/etc/routes.xsd">
    <router id="standard">
        <route id="helloworld" frontName="helloworld">
            <module name="GregT_Hello" />
        </route>
    </router>
    </config>

Gregt/Hello/etc - module.xml

    <?xml version="1.0"?>

    <config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xsi:noNamespaceSchemaLocation="urn:magento:framework:Module/etc/module.xsd">
    <module name="GregT_Hello" setup_version="1.0.0">
    </module>
    </config>

Gregt/Hello/view/frontend/templates - helloworld.phtml

<?php echo $block->getHelloWorldTxt(); ?>

Gregt/Hello - registration.php

    <?php

    \Magento\Framework\Component\ComponentRegistrar::register(
    \Magento\Framework\Component\ComponentRegistrar::MODULE,
    'GregT_Hello',
     __DIR__
    );

[![enter image description here][2]][2]

  [2]: https://i.stack.imgur.com/NWuFv.png


texts: Get multiple select product attribute's option labels instead of option IDs

texts:
I have a product attribute, Available Sizes in Magento. The input type is Multiple Select.

The options for the attribute are Small, Medium and Large.

Normally when I call a product attribute on the frontend, I use echo $_product->getAttributeCode();

With this attribute, when I use echo $product->getAvailableSizes(); it is giving me the values for the product like 13 or 14,13 - I assume these are the IDs of the options, rather than the labels.

I want to print out the options as text rather than IDs.

What I want is something like Small or Small,Medium. Can I get the attribute in this format without having to resort to if statements like if value is 13, echo "Small" etc. I want to do something more dynamic than that if possible!

For reference I am working on the catalog/product/view.phtml and catalog/product/list.phtml views.

Many thanks. I'm working with EE 1.14.0.1.


texts: How to display customer name when logged in Magento 2?

texts:
I am trying to display a customer's name after login (M2 version)

Question: How do I display a customer's name after login in Magento 2?

I see here it is a little more difficult: Customer name is not display after login in magento 2


texts: Debugging cron error .update_in_progress.flag: failed to open dir: No such file or directory

texts:
I've got a Magento2 instance running from 1 year.
Since last week I'm receiving once/twice a day an email whith the following cron error
In File.php line 405:

  FilesystemIterator::__construct(/var/.update
  _in_progress.flag): failed to open dir: No such file or directory

setup:cron:run [--magento-init-params MAGENTO-INIT-PARAMS]

Any ideas?


texts:
My team has build an e-commerce project on magento cloud. But our tutor is asking for the whole project to be downloaded so that he can review it on his local host and give us the feedback.

Can anyone help me to sort out this situation?


texts: FedEX home delivery shipping method does not displaying when total items weight in cart is grater than 70 lbw

texts:
I am trying to display Fed Ex shipping method on checkout page, From admin home delivery option is selected and Residential Delivery set to yes.

Issue is when in cart items total weights is grater than 70 lbs then Home delivery option does not display, if weight is less than 70 lbw it displays,

Can any one explain why this happen or how to display Home delivery shipping method for items weight is grater than 70

thanks,


texts: How to get all oAuth2.0 details for POSTMAN REST API?

texts: How can i get oAuth 2.0 details for magento 1.9.2.3,


texts: Magento 2.3 - "The value of Admin scope can't be empty" error when adding new product attribute

texts:
In magento 2.3 I tried to add New Product Attribute and chose Text Swatch for input type but I got the error message: "The value of Admin scope can't be empty.
"


texts: Magento 2 Custom module installation time create media directory

texts:
I want to create media directory with 777 recursive permission on custom module installation time, So I have created createDirectory function in InstallSchema.
But currently directory is created with drwxrwxr-x permission. so i want to give 777 permission.

Here is my InstallSchema.php.

<?php

/**
 * VendorNameSpace ModuleName
 * Class Description
 */

namespace VendorNameSpace\ModuleName\Setup;

use Magento\Framework\Setup\InstallSchemaInterface;
use Magento\Framework\Setup\ModuleContextInterface;
use Magento\Framework\Setup\SchemaSetupInterface;
use Magento\Framework\DB\Ddl\Table;
use Magento\Framework\DB\Adapter\AdapterInterface;
use Magento\Framework\App\Filesystem\DirectoryList;

class InstallSchema implements InstallSchemaInterface {

    /**
     * Blog Post Module's Media Directories
     */
    const MEDIA_TMP_PATH = 'vendornamespace/modulename/tmp/upload';
    const MEDIA_PATH = 'vendornamespace/modulename/upload';

    /**
     * @var Magento\Framework\App\Filesystem\DirectoryList
     */
    private $_directoryList;

    /**
     * @var Magento\Framework\Filesystem\Io\File
     */
    private $_ioFile;

    /**
     * @param \Magento\Framework\Filesystem\Io\File $ioFile
     * @param \Magento\Framework\App\Filesystem\DirectoryList $directoryList
     */
    public function __construct(
        \Magento\Framework\Filesystem\Io\File $ioFile,
        \Magento\Framework\App\Filesystem\DirectoryList $directoryList
    ) {
        $this->_ioFile = $ioFile;
        $this->_directoryList = $directoryList;
    }

    /**
     * {@inheritdoc}
     * @SuppressWarnings(PHPMD.ExcessiveMethodLength)
     */
    public function install(
        SchemaSetupInterface $setup,
        ModuleContextInterface $context
    ) {

        $this->_createMediaDir();

        /**
         * Database Script
         *
         *
         *  ......
         */

    }

    /**
     * Creating Media Directories
     */
    protected function _createMediaDir() {

        $mediaTemp = $this->_directoryList->getPath(DirectoryList::MEDIA) . DIRECTORY_SEPARATOR . SELF::MEDIA_TMP_PATH;
        $media = $this->_directoryList->getPath(DirectoryList::MEDIA) . DIRECTORY_SEPARATOR . SELF::MEDIA_PATH;

        $directories = [$media, $mediaTemp];
        $ioAdapter = $this->_ioFile;

        foreach ($directories as $dir) {
            if(!is_dir($dir)){
                $ioAdapter->mkdir($dir,0777);
            }
        }

    }
}


texts:
How can redirect to a CMS page when the "add to cart button" (on a product view page) is clicked?

I have already disabled the redirect to the cart page after the "add to cart" button is clicked. Now I need to know what code edits to make to direct the browser to a new page.


texts: Get product type and category collections in magento

texts:
I am creating a custom admin module. One of its tab, I need to add two dropdowns. One for selecting available product types in magento and another one for selecting available categories in magento. How can I achieve this? Please provide some hints for this.

I have searched a lot. But almost all results saying about getting product type and category according of a product that has loaded by an id. I dont want to load any products for this. Just want to get product type and category collections.

Please direct me properly. Thanks in advance


texts: Magento 2 - add condition rule block in custom grid

texts:
I want to add condition rule block in my custom grid.
I want to use it as a filter and want to search products using condition rules.

I used this link
 as reference.


texts: Extending Magento API with customer login

texts:
I followed a lot of tutorials about how to extend Magento API but I didn't figure it out why I always get "Invalid api path." My goal is to extend Mage_Customer_Model_Customer_Api in order to add a new method to login a customer in site. I don't know if something like that is possible, but I need at least to be able to add a new method which just returns a message.

Can someone provide me a link where I can find a working module
which extends Magento API?
Is it possible what I want to achieve?
Thank you,

Yeee..I figured out "Invalid api path." error. Instead of calling

$result = $client->call($session_id, 'gw_base_order.createandcapture');

it has to be

$result = $client->call($session_id, 'resource_name.createandcapture');

Wrong tuturial: Extending Magento API and others like this.

I still need an answer for the second question.


texts: Magento 2 Problem with arguments in di.xml

texts:
The problem is this: I have a module, which passes arguments from di.xml to a class. Deploy mode is a developer.

When I make changes in any arbitrary module or install a new module, and subsequently run bin/magento setup:upgrade. Then when I open the front page, which uses this module, I get the error for this module:

  (BadMethodCallException): Missing required argument

I was lead to believe that developer mode setup:di:compile is not necessary, but I'd like to have this confirmed. It seems to me a little strange, cause unless I run setup:di:compile this error keeps propping up.


texts: Filter Layered Navigation: Specify Filter for Subcategory

texts:
I set up a category-based navigation on our central shop page and added some filters. I also added some subcategories to the main-shop category, in order to make the products more accessible.
My Problem now is: there does not seem to be a way of adding filters to certain sub-categories.

Example:
Let's say you clicked on my category page "Sports" (subcategory), you maybe want to filter ingredients (like vitamins, magnesium...). So I want to add an attribute-based filter to the sub-category-page - named "ingredients" - that makes it easier for you to filter the magnesium-based products on the page.


texts: Custom image is not creating if Guest create Product Programtically

texts:
Once Registered user upload custom image on Product view image & click on button, We are creating Product programtically with custom image.

but when guest click on same button after uploading custom image, Product is creating with static image [ Image which is present in media/example/amasty folder]

We want to create product with custom image for guest also....

protected function _createProduct($type, $doSave=true, $originalProduct, $newImagePath="")
{
        $product = Mage::getModel('catalog/product');

        $product->setName($originalProduct->getName());

        $customerId = Mage::getSingleton('customer/session')->getCustomerId();
        $product->setCreatedByCustomerId($customerId);

        $images = array(
            'thumbnail'   => 'image.png',
            'image'       => 'image.png',
        );

        foreach ($images as $imageType => $imageFileName) {
            if($newImagePath != ""){
                $dir = Mage::getBaseDir('media') . DS . 'custom_product_preview/quote/';
                $path = $dir . $newImagePath;
            }else{
                $dir = Mage::getBaseDir('media') . DS . 'example/amasty/';
                $path = $dir . $imageFileName;
            }

            if (file_exists($path)) {
                try {
                    $product->addImageToMediaGallery($path, $imageType, false);
                } catch (Exception $e) {
                    echo $e->getMessage();
                }
            } else {
                echo "Can not find image by path: `{$path}`<br/>";
            }
        }

        if ($doSave)
            $product->save();

        return $product;
    }

full controllers : https://pastebin.com/Gn6iMwug


texts: Brute Force attack error in magereport tester

texts:
We are having issue with the 'BRUTEFORCE ATTACK ?' option in magereport.

We are trying to install the 8788 patch on website. Was successfully able to install the 8788 patches on the website but not able to fix the 'BRUTEFORCE' option mentioned in magereport. The .htaccess rules are working on normal linux servers and also plesk servers but we are having issues with the same rule on Cpanel server's.

We have tried all the possible combinations to fix the error but this is still showing. Do any one have an idea on this? Why is the error still showing where as the same rule works on plesk/No interface server while it is not working on a Cpanel server? Please let us know.

Below rule is used.

Please note - both downloader and admin url is renamed.

RewriteCond %{REMOTE_ADDR} !^xx.xx.xx.xx
RewriteRule ^(index.php/?)?rss/ - [L,R=403]
RewriteCond %{REMOTE_ADDR} !^xx.xx.xx.xx
RewriteRule ^(index.php?)?rss/ - [L,R=403]


texts:
How to print customer array full data.

public function __construct(
    \Magento\Customer\Model\Customer $customermodel,
    \Magento\Customer\Model\Address $addressmodel,
    \Magento\Customer\Api\CustomerRepositoryInterface $customer
)
{
    $this->_customer = $customer;
    $this->_address = $addressmodel;
    $this->_customermodel = $customermodel;
}
$customerData = $this->_customer->getById($customerId);

How to print this $customerData ?


texts: Magento 2 : how to show custom product slider on home page?

texts:
I need custom product slider or collection on the home page in Magento 2.1? How can I do that?

Product Collection manages with product attribute.


texts:
I want to remove some new category attributes but it is not working.
Am I missing something? I dont know what is the problem. Please someone help it..

UpgradeData.php

<?php

namespace Vendor\Module\Setup;

use Magento\Eav\Setup\EavSetup;
use Magento\Eav\Setup\EavSetupFactory;
use Magento\Framework\Setup\ModuleContextInterface;
use Magento\Framework\Setup\ModuleDataSetupInterface;
use Magento\Framework\Setup\UpgradeDataInterface;

class UpgradeData implements UpgradeDataInterface
{
    private $eavSetupFactory;

    public function __construct(EavSetupFactory $eavSetupFactory)
    {
       $this->eavSetupFactory = $eavSetupFactory;

    }

    public function upgrade(ModuleDataSetupInterface $setup, ModuleContextInterface $context)
    {

        $setup->startSetup();
        if (version_compare($context->getVersion(), '1.0.6') > 0){

            $eavSetup = $this->eavSetupFactory->create(['setup' => $setup]);

            $eavSetup->removeAttribute(\Magento\Catalog\Model\Category::ENTITY, 'category_title');
        }
        $setup->endSetup();

    }

}

Module.xml

<?xml version="1.0"?>
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../lib/internal/Magento/Framework/Module/etc/module.xsd">
    <module name="Vendor_Module" setup_version="1.0.5">
        <sequence>
            <module name="Magento_Backend"/>
             <module name="Magento_Sales"/>
            <module name="Magento_Quote"/>
            <module name="Magento_Checkout"/>
            <module name="Magento_Cms"/>
        </sequence>
    </module>
</config>


texts: Removing link from root category on topmenu

texts:
I am trying to make the topmenu root category not clickable using this method

  https://community.magento.com/t5/Magento-2-x-Programming/Remove-links-to-top-categories-in-menu/td-p/77072

but it doesn't seem to work. Anybody as a solution for this I've been looking for the past 5 hours.


texts: Problem with patch SUPEE-10888 on Magento 1.9.0.1

texts:
Problem with patch PATCH_SUPEE-10888_CE_v1.9.0.1_v1-2018-09-19-03-00-53.sh on Magento 1.9.0.1, with all previous patches installed:

Checking if patch can be applied/reverted successfully...
ERROR: Patch can't be applied/reverted successfully.

patching file app/code/core/Mage/Admin/Model/User.php
Hunk #2 succeeded at 623 (offset -19 lines).
patching file app/code/core/Mage/Admin/etc/config.xml
patching file app/code/core/Mage/Adminhtml/Block/Catalog/Product/Edit/Tab/Super/Config.php
patching file app/code/core/Mage/Adminhtml/Block/Widget/Grid/Massaction/Abstract.php
patching file app/code/core/Mage/Adminhtml/Model/LayoutUpdate/Validator.php
Hunk #2 FAILED at 57.
Hunk #3 succeeded at 80 (offset -12 lines).
Hunk #4 succeeded at 115 with fuzz 2 (offset -12 lines).
Hunk #5 succeeded at 139 with fuzz 1 (offset -21 lines).
Hunk #6 succeeded at 161 (offset -21 lines).
1 out of 6 hunks FAILED -- saving rejects to file app/code/core/Mage/Adminhtml/Model/LayoutUpdate/Validator.php.rej
patching file app/code/core/Mage/Adminhtml/controllers/Catalog/ProductController.php
Hunk #1 succeeded at 1029 (offset -1 lines).

Does anyone recognize this error message?

Solution
Installing SUPEE-10752 was the solution.


texts: What is the order of execution of setup scripts in a module?

texts:
1) Can there be multiple install scripts in the custom module? For example:

data-install-1.0.0.php
data-install-1.0.1.php

2) Assuming I have the following scripts inside app/code/local/Company/Helloworld/data/helloworld_setup:

data-install-1.0.0.php
data-install-1.0.1.php
data-install-1.0.2.php
data-install-2.0.0.php
data-upgrade-1.0.0-1.0.1.php
data-upgrade-1.0.1-1.0.2.php
data-upgrade-1.0.2-2.0.0.php
data-upgrade-2.0.0-2.0.1.php

Questions:

2.1) I already have version 1.0.0 of this module installed in my Magento:

<config>
    <modules>
        <Company_Helloworld>
            <version>1.0.0</version>
        </Company_Helloworld>
    </modules>
...
</config>

What will be the order of execution of these scripts when:

2.1.a) I install version 1.0.2

2.1.b) I install version 2.0.0

2.2) I don't have any version of this module installed yet.
What will be the order of execution of these scripts when:

2.2.a) I install version 1.0.0

2.2.b) I install version 2.0.0

2.2.c) I install version 3.0.0

3) I've seen in Magento core modules, the sql install scripts are named in two ways:

mysql4-install-1.0.0.php
install-1.0.0.php

When is mysql4- required in the script name? When can I remove mysql4- from the name? Does it depend on Magento version?


texts: Move menu bar has moved after site migration

texts:
since site mirgration of my site all of a sudden my menu has moved

http://kferreiradesigns.com.au/

anyone know what file i need to edit to move it back

thanks in-advance


texts: How to disable auto collapse in mobile menu?

texts:
In mobile menu of Magento 2 when we click any child item of a parent, the parent collapse [see the image]

what can i do to disable this behaviour.

  Demo: http://magento2-demo.nexcess.net/contact


texts: How to add MSI Integration in Magento 2.1

texts: I am using Magento 2.1. I know Multi-store inventory is available in Magento 2.3. But now I need to add multiple sources for Magento 2.1. I couldn't find any blogs or information regarding this.


texts: What is the best way to override a controller class?

texts:
As I know there are two ways to override a controller class.

Using from/to tags in config.xml

                    Considering the router below, "/mymodule/checkout_cart/" will be
                    "translated" to "/MyNameSpace/MyModule/controllers/Checkout/CartController.php" (?)
                -->
                <to>/mymodule/checkout_cart/</to>
            </mynamespace_mymodule_checkout_cart>
        </rewrite>
    </global>

Using 'before' keyword in config.xml

 <config>
        <admin>
            <routers>
                <adminhtml>
                    <args>
                        <modules>
                            <mynamespace_mymodule before="Mage_Adminhtml">Mynamespace_Mymodule_Adminhtml</mynamespace_mymodule >
                        </modules>
                    </args>
                </adminhtml>
            </routers>
        </admin>
    </config>

Can anyone explain what is the best way to override a controller or the above methodologies are using for different purposes of overriding. Any suggestions will be appreciated.

Thank you.


texts: CSS custom design not applied after upgrading my magento

texts:
I upgraded magento to the newest version 1.9.3.3 and now it doesn't apply the custom css.
I cleared the cache, checked the htaccess file and permissions. All fine and it was working before the upgrading.

So what can I do so that the custom css will be applied?


texts: Header and footer are not showing in contact us email in Magento 2

texts:
I have override contact module and changed email type from text to html by following this link.

I want to show same header and footer in contact email also. When I check the preview of the template in the admin panel, it is showing fine, but when email goes to particular email, header and footer in the email are not showing.

I have checked many other threads for header and footer not loading in the custom email in Magento 2, but none of those worked for me.

I have also tried to copy and paste HTML of header and footer into contact email template, but there was no luck.

Please help me to solve this issue.


texts: magento 2 proper way of using the events to capture the admin login success and login failure

texts: What are the steps in magento 2 to use the events to capture the admin login success or admin login fail.


texts: Magento 2 - Reflect CSS changes without deleting Cache/CLI

texts:
Is it possible to reflect CSS/JS/XML/Catalog changes on storefront without deleting below folders and running CLI commands

pub/static/frontend
var/view_preprocessed
php bin/magento indexer:reindex
php bin/magento cache:flush

We are doing minor CSS changes and in order to reflect our changes on frontend, every time we have to delete above folders and clear cache. For Catalog changes we also have to reindex data.

A developer may know the process to delete folders and flush cache and also how to run CLI commands. But assuming a use case where admin is making changes or a designer is working on CSS files, how could they see their changes without going through deletion process.

How could I perform and push my changes to storefront without deleting folders and running CLI commands considering a use case where a designer is given access to magento store theme path only.


texts: How to remove Edit and Delete button from mini-cart and cart page for specific product?

texts: I want to remove edit and delete button from mini-cart and cart page for specific product only. How can I do this? Any help would be appreciated. Thanks.


texts: EE 1.14.2 / CE 1.9.2: Quote items not merged correctly on login (duplicate products in cart)

texts:
I found a weird bug in Magento EE 1.14.2 (also affects CE 1.9.2) with the cart.

Steps to reproduce:

Log in as customer A
Add product X to the cart
Switch to a different browser
Add product X to the cart
Log in as customer A

Expected cart:

2 x Product X

Actual cart:

1 x Product X
1 x Product X

I.e. the products are not merged.

Instead of switching the browser you could also clear the session cookie or choose a different qty for the product.

The worst side effect of this is that maximum order quantity is applied per item. In my case, there was a 100% discount on a product but you could only order it once. With this little trick, you could order it in any quantity, for free.

Why does this happen and how can I prevent it?


texts: Email template not showing in full width in iPhone7.

texts:
In iPhone7 default email app Email template not showing in full width.

There is not any customization, this is Magento 2.1.10 default email.

Email are showing as below screenshot.

Can someone help to resolve this issue. ?

Thanks..!


texts: Is there customer session support via Magento's REST api?

texts: I'm working on extending wishlist functionality to Magento's REST api.  It would be nice to access the customer's session.  Does Magento have any support for accessing the customer's session via REST?


texts: Magento Go: How to display Product description on Homepage/Category page

texts:
I am working on a site in Magento Go where I am displaying product listing on Homepage and Category Pages. For reference:

https://vimergy.gostorego.com/

I want to display a small product description under each product. I have created an attribute for the same, but how can I achieve this in Magento Go?

Any help would be appreciated!


texts: How can I remove the sku only for grouped products? Since a grouped product is composed of many simple products, I do not need the grouped product sku to display. How can I remove this only for the grouped product?


texts: Remove store-language-container; magento 1.9

texts:
Magento newbie here - I have followed the Magento C.E. 1.9 RWD Designer's Guide instructions/tutorial with success with regard to where it leaves off.  I have successfully created a directory structure, copied over files from images and scss to my new theme, and verified my new theme.  I understand that the preferred method to make layout changes is through theme.xml.  I have successfully created this basic file.  I also understand that changes should be made by layout update and not through local.xml.

With all this being said, I can not seem to figure out how to create and structure a layout update to remove the language switcher/store-language-container.(though I could probably hack it but I'd like to learn the right way)  Specifically, the examples from Eric Wiese and Alan Storm make generous use of the words "default" in the examples and other words in the "<>" brackets that I can't seem to follow and apply to my directory structure (For example, I can't figure out what "" is referencing in Eric Wiese's tutorial).  I admit I'm rather new to XML.

So, can someone help me discern how to create the XML files to remove the language switcher/store-language-container using the preferred XML method?  I am hopeful that this example will help me with the rest of the modifications I need to make.  My directory structure is exactly the same as in the Magento CE 1.9 RWD tutorial.  Thanks a million in advance.


texts: use of getId() & setId() in mage_core_model_abstract

texts:
I want to understand functions of mage_core_model_abstract.

For this I'm using Mage::log() function in different places.

and I'm using custom module with model.

I'm thinking getId() & setId() functions will call If i save new record in db or update exist record of model in the process of save() function.

But in magento log i'm not getting any values.

For example my custom module with 3 fields(entity_id(primary key & auto increment),field1,field2).
and I have 3 records like this

1 apple yellow

2 flower green

3 fruit  red

If i edit first record & save I should get $object->getId() value "1" In

  Mage_Core_Model_Resource_Db_Abstract::save(Mage_Core_Model_Abstract
  $object).

If I add new record magento should pass "4" value to  $object->setId($id).

please look at line $object->setId($this->_getWriteAdapter()->lastInsertId($this->getMainTable()));
Am i correct?

update:
following updated successfully.Normally everyone using load($id) function.

 $_book = Mage::getModel('namespace_module/mydata');
$_book->setId(7)->setField1('85')->setField2("jkl")->save();


texts: Magento 1.9 / Mysql - How to add 'shipping carrier(title)' column to shipping grid?

texts:
I'm gonna add the column in my order -> shipment grid!

I want to bring the "title" on 'sales_flat_shipment_track' table.
And it has also "parent_id" column, means entity_id on sales_flat_shipment!

  sales_flat_shipment_track

  sales_flat_shipment

So i need to implement this requirment to Mage_Adminhtml_Block_Sales_Shipment_Grid

What code do i have to insert to
protected function _prepareCollection() & protected function _prepareColumns() ?

I tried :

    protected function _prepareCollection()
{
    $collection = Mage::getResourceModel($this->_getCollectionClass());
    $collection->getSelect()->join('sales_flat_shipment_track', 'main_table.entity_id = sales_flat_shipment_track.parent_id', array('title'));

    $this->setCollection($collection);
    return parent::_prepareCollection();
}

    protected function _prepareColumns()
{
    $methods = Mage::getSingleton('shipping/config')->getActiveCarriers();
    $shippingmethods = array();
    foreach($methods as $_ccode => $_carrier) {
        if($_methods = $_carrier->getAllowedMethods())  {
            if(!$_title = Mage::getStoreConfig("carriers/$_ccode/title"))
                 $_title = $_ccode;
               foreach($_methods as $_mcode => $_method)   {
                $_code = $_ccode . '_' . $_mcode;
                $shippingmethods[$_code]= $_title;
            }
        }
    }

     $this->addColumn('title', array(
        'header'=> Mage::helper('sales')->__('Shipping Method'),
        'width' => '80px',
        'type'  => 'options',
        'index' => 'title',
        'options' => $shippingmethods,
        ));

}

Please let me know it

Thank you so much!


texts: Magento 2.3 - After migration from 1.9 to 2.3 vendor/magento files missing

texts:
After migration from Magento 1.9.2.3 to Magento 2.3.4 most of the files missing from vendor/magento.
But all the files located under app/code/Magento
Is this safe, shall i run my Magento 2.3.4 in this situation?
What about my future version upgrade?


texts: Magento cron.php/cron.sh not working when executed through cPanel Cron Job

texts:
I tried these two commands from SSH. They worked.

/bin/sh /path/to/magento/cron.sh
/usr/bin/php /path/to/magento/cron.php

I put exactly the same commands (either one) on cPanel Cron Job. The commands were executed, but nothing happened. What might be wrong here?

Curl command works, but i'm trying to make cron.php not accessible from outside.


texts: Remove entry from top links (after malware)

texts:
I had a malware on my page and after that the entry "Our Team" appears on the top linke of my page www.worg.ch.
I would like to remove this link again.
I was looking for local.xml but I cannot find the file :-(
I also checked customer.xml and checkout.xml but there is no such entry in the file.
Magento Version: 1.9.0.1
Any idea how to remove this entry?

head.phtml:

<meta http-equiv="Content-Type" content="<?php echo $this->getContentType() ?>" />

getTitle() ?>
getDescription()) ?>" />
getKeywords()) ?>" />
getRobots()) ?>" />
getFaviconFile(); ?>" type="image/x-icon" />
getFaviconFile(); ?>" type="image/x-icon" />

//helper('core/js')->getJsUrl('blank.html') ?>';
    var BLANK_IMG = 'helper('core/js')->getJsUrl('spacer.gif') ?>';
//]]>

getCssJsHtml() ?>
getChildHtml() ?>
helper('core/js')->getTranslatorScript() ?>
getIncludes() ?>

header.phtml:

            getChildHtml('welcome') ?> getAdditionalHtml() ?>
            getChildHtml('topLinks') ?>

        getChildHtml('headerCart') ?>
        getChildHtml('store_language') ?>

        getIsHomePage()):?>
        getLogoAlt() ?>getUrl('') ?>" title="getLogoAlt() ?>" class="logo">getLogoSrc() ?>" alt="getLogoAlt() ?>" />

        getUrl('') ?>" title="getLogoAlt() ?>" class="logo">getLogoAlt() ?>getLogoSrc() ?>" alt="getLogoAlt() ?>" />

        __('Skip to Main Content') ?> »
        getChildHtml('topSearch') ?>

        getChildHtml('topMenu') ?>

     getChildHtml('topContainer'); ?>

links.phtml:

<?php $_links = $this->getLinks(); ?>

0): ?>
getName()): ?> id="getName() ?>">

            toHtml() ?>

            getIsFirst()||$_link->getIsLast()): ?> class="getIsFirst()): ?>firstgetIsLast()): ?> last" getLiParams() ?>>getBeforeText() ?>getUrl() ?>" title="getTitle() ?>" getAParams() ?>>getLabel() ?>getAfterText() ?>

linksblock.phtml:

<li<?php if($this->getIsFirst()||$this->getIsLast()): ?> class="<?php if($this->getIsFirst()): ?>first<?php endif; ?><?php if($this->getIsLast()): ?> last<?php endif; ?>"<?php endif; ?> <?php echo $this->getLiParams() ?>><?php echo $this->getBeforeText() ?><a href="<?php echo $this->getLinkUrl() ?>" title="<?php echo $this->getTitle() ?>" <?php echo $this->getAParams() ?>><?php echo $this->getLabel() ?><?php echo $this->getAfterText() ?>


texts: How to detect if a child product's parent has a catalog rule applied?

texts:
I'm trying to determine if a child products configurable parent has a price rule applied.

I can get the correct price on the parent product by loading the parent, and then calling getFinalPrice(), but the challenge is that on configurable products that do not have a rule applied, getFinalPrice() on the parent returns the lowest price of it's child components:

$product = Mage::getModel('catalog/product')->load($child_id);
$child_price = $product->getFinalPrice(); // Full price of child

$parent_product_ids = Mage::getModel('catalog/product_type_configurable')->getParentIdsByChild($child_id);
$parent_id = $parent_product_ids[0]; // presume 1 parent config product
$parent_product = Mage::getModel('catalog/product')->load($parent_id);
$parent_product_price = $parent_product->getFinalPrice(); // Price with catalog rule applied

I want to display the price with the rule applied to the child product (which is what you see in the cart after adding the child product from the product page.

Any tips appreciated.


texts: I want to hide the product description and review tabs but

texts:
I have just short product descriptions (jewelry shop) and i think it is best to ad that to the short description so this also shows when people share through FB, Twitter etc.

I think these share options use the short description... correct?

If that is true i do not have any need to show description and neither the review tab

To remove this i thought i had to got to : Cataglogue > Attributes > Manage Attribute Sets

Than select default (the only set i have)

Than drag and drop the description from Group to Non assigned attributes

But...

I get the message that i can not do this because it is a system attribute

How can i enable it?

Thanks


texts: Magento 2 Where can I find a xml file location?

texts:
Where can I find the location of customer/create_account/email_identity?

const XML_PATH_REGISTER_EMAIL_IDENTITY = 'customer/create_account/email_identity';


texts: Adding link to customer account menu for selected users

texts:
I got this code, and that works well:

<customer_account translate="label">
    <reference name="customer_account_navigation">
        <action method="addLink"><name>someName</name><path>somePath</path><label>Some Label</label></action>
    </reference>
</customer_account>

But I just want to add this customer account navigation link for specific customers. I would be able to write some PHP what acquires the information if the user should view the custom navigation link, but i cannot do this with XML.

What is the solution for this problem?


texts: Bulk Discount on quantity based by percentage

texts:
I am using standard Configurable and simple product.
I want to add bulk discount for all users on  matching products Only .
I can't do it from catalog product tier price rule  option because i have a large  catalog so i can't Do it manually   in every product.My condition is.  if Quantity of products  is 7 to 24 discount = 5%
and if qty of products equal to and greeter than 25 discount should be 10%.
Thanks in Advance.


texts:
Want to get all Sql queries during the page load.

can any one help me on How to log all Magento 2 SQL queries ?


texts: Magento 2: Tax by product category by region

texts:
Tax zones and rules are pretty straight forward in Magento but I am struggling with a final detail.

I have all the tax set up by province in Canada. That's working well. Only one category of product is partially exempt tax in 3 provinces. It's easy to see how to set up a product tax class, but it's not straight forward to figure out how to exempt tax based on a couple regions.
I'm sure there is something simple I am missing - I don't want the product category to be tax exempt, I only want part of the tax (pst) to be exempt in 3 provinces, but apply in other provinces.


texts: Require locate wrong folder location of jquery-storageapi

texts:
I have enabled developer mode. And I cannot find any version folders under static.
I have tried to clean the cache but it didn't work.
Anyone can help me on this?
Thanks!


texts:
I created form but I don't know how to add a controller to send mail with these field

     public function saveAction()
     {
        //on recuperes les données envoyées en POST
        $orderid = ''.$this->getRequest()->getPost('orderid');
        $reason = ''.$this->getRequest()->getPost('reason');
          //on verifie que les champs ne sont pas vide
        if(isset($orderid)&&($orderid!='') && isset($reason)&&($reason!=''))
       {
          //on cree notre objet et on l'enregistre en base
          $contact = Mage::getModel('test/test');
          $contact->setData('orderid', $orderid);
          $contact->setData('reason', $reason);

          $contact->save();
       }
        $body ='Hi admin, '.$orderid. 'reason'.$reason;
    $mail = Mage::getModel('core/email');
    $mail->setToName($name);
    $mail->setToEmail('mymail@gmail.com');
    $mail->setBody($body);

    $mail->setSubject('Not Support Pincode');
    $mail->setFromEmail('totaltoys.com');
    $mail->setFromName($name);
    $mail->setType('html');// You can use 'html' or 'text'

    try {
    $mail->send();
    //Mage::getSingleton('core/session')->addSuccess('Your request has been sent');
    //$this->_redirect('');
    }
    catch (Exception $e) {
    //Mage::getSingleton('core/session')->addError('Unable to send.');
   // $this->_redirect('');
    }
       //on redirige l’utilisateur vers la méthode index du controller indexController
       //de notre module test
       $this->_redirect('test/index/index');
    }

form.phtml

<form action="<?php echo Mage::getUrl('test/index/save') ?>" method="post">

<?php echo "Order Cancel Request Form"; ?>

            Your Order Id :  <input id ="orderid" type="text" value = "<?php echo Mage::app()->getRequest()->getParam('ref');?>" readonly>

        Reason Of Cancel :
        <textarea id="reason" rows="4" cols="50">  </textarea>

    <input type="button" value="submit">

</form>


texts: Catalog: Custom Product Collection, mode switch (grid/list) bug?

texts:
Edit: I think I found a solution. (See answer by me below)

I have a product collection which I pass to the Magento catalog/product_list block. I've set curPage and pageSize of the collection and pagination is working fine except the weird behavior I try to describe below.

In my case I have 15 products.

Default View Mode = Grid
Products per Page on Grid = 12 (Default Value)
Products per Page on List = 10 (Default Value)

When I view my collection in the catalog(frontend), default view mode is Grid, and I change the limit (Products per Page) to 24, all 15 products are shown on the first page. So far so good. But when I switch mode to list it shows me all 15 products on the first page but it also gives the possibility to go to the second page which contains the same 15 products.

Here my code:

    $curPage = 1;
    $mode = Mage::getStoreConfig('catalog/frontend/list_mode');
    $grid_products_per_page = explode(',', Mage::getStoreConfig('catalog/frontend/grid_per_page_values'));
    $list_products_per_page = explode(',', Mage::getStoreConfig('catalog/frontend/list_per_page_values'));

    //Default Values
    if($mode == 'grid' || $mode == 'grid-list') {
        $pageSize = Mage::getStoreConfig('catalog/frontend/grid_per_page');
    } else {
        $pageSize = Mage::getStoreConfig('catalog/frontend/list_per_page');
    }

    $mode = ($_GET['mode'] != null ? $_GET['mode'] : $mode);
    $pageSize = ($_GET['limit'] != null ? $_GET['limit'] : $pageSize);
    $curPage = ($_GET['p'] != null ? $_GET['p'] : $curPage);

    //Supposed to handle mode switch
    if($mode == 'grid') {
        $pageSize = $this->getClosestNumber($pageSize, $grid_products_per_page);
    } elseif($mode == 'list') {
        $pageSize = $this->getClosestNumber($pageSize, $list_products_per_page);
    }

    /*
     * Fill product_result_ids array...
     */

    $productCollection = Mage::getModel('catalog/product')->getCollection()
        ->addAttributeToSelect('*')
        ->addIdFilter($product_result_ids);
    $productCollection->setPageSize($pageSize);
    $productCollection->setCurPage($curPage);
    $productCollection->count();

    //The numbers seem to be correct
    echo $productCollection->count().'
';
    echo $curPage.'
';
    echo $pageSize.'
';

    return $productCollection;

If any more information is needed, please tell me. Thanks.


texts:
I recently transferred servers and ever since my timestamps in Magento (both orders and help desk messages) are incorrect. I have checked all of my configuration settings, and they are correct. I have tried all of these:
https://magentocookbook.wordpress.com/2010/02/15/magento-date-time/ which gave me a 404 site wide. I
followed this guide to edit .htaccess: https://www.a2hosting.com/kb/developer-corner/php/using-php-directives-in-custom-htaccess-files/setting-the-php-time-zone-in-an-htaccess-file
and have built the  script and from what I can tell it says our timezone is correct.
Any assistance as to what may be causing this sort of issue or how to fix would be appreciated!


texts: Send order data as json code to different URL in Magento

texts:
We need to submit order data like order number, product and shipping data to another url using json in Magento after the user placed an order?

Please don't vote minus if it is not clear I can clarify just If you can help If no please let my question I need a help in this point.

Thanks,


texts: Move related products to custom div in custom phtml template

texts:
I have made a custom phtml template called configurator.phtml on the product view page, like this:

    <referenceContainer name="page.wrapper">
        <block class="Magento\Catalog\Block\Product\View" name="configurator" template="product/view/configurator/configurator.phtml" before="-">
        </block>
    </referenceContainer>

The template looks like this:

<?php echo __('Configurator') ?>

<?php echo __("Do the meals come close to what you want, but is there something in the box why it isn't perfect? Here you can edit the meals inside your box, to make the perfect box for you!") ?>

        close

<?php echo __('Meals') ?>

<?php echo __('Ingredients') ?>

<?php echo __('Extra') ?>

Inside .meal-selector-products I want to display the related products. How can I move the related products to a custom div? I just can't figure out how to do it...


texts: Can you have 2 or more billing addresses in Magento2 for one customer?

texts: Is there a setting in the admin? I know there is one for shipping addresses... I know theoretically one customer can have one or more addresses, but does it even make sense to have more than one billing address? Thanks.


texts: 2 responsive promo's columns on frontpage Magento RWD

texts:
how do i make 2 responsive promo columns instead of the default 3?

I see this code which makes the 3 responsive pomps/banners on the frontpage:

@include bp(min-width, $bp-medium + 1) {

.promos span {
    font-size: 16px;
}

.promos strong {
    font-size: 17px;
}

/* Config: Three columns + flexible gutter */
// Container: 480 - (2 * 30 trim wide) = 420
// Math: (420 - (2 * 10 gutter)) / 3 items = 133.333333333
body .promos > li {
    float: left;
    width: percentage(133.333333333 / 420);
    margin-right: percentage(10 / 420);
}

.promos > li:nth-child(3n) {
    margin-right: 0;
}
}


texts: CSV import checked rows != checked entities

texts:
I have a really weird "bug", (I call it like this), while importing products with csv importer controller.

  Look at this :

1: Begin data validation

2: The validation is complete.

3: Checked rows: 2283, checked entities: 2283, invalid rows: 0, total errors: 0

4: Import data validation is complete.

1: Begin import of "catalog_product" with "append" behavior

2: Checked rows: 0, checked entities: 500, invalid rows: 0, total errors: 0

3: The import was successful.

Any idea what I am doing wrong ?
I look the 500th product it seems well.


texts: Datepicker not working while creating special price

texts: Whenever I am trying to create a special price for a product and try to select the from and to dates for the same the date is not getting selected at all, I have to enter it manually every time. How can I correct this?


texts: Magento 2 - Custom Variable | How to get the Plain Value as well as HTML value using directive {{CustomVar code="CUSTOM_VAR_CODE"}} in CMS Blocks?

texts:
I have added the Custom Variable from Admin > System > Other settings > Custom Variables >  Add New Variable, it is possible to add both the Variable HTML Value as well as Variable Plain Value as in the screen shot below

When using the directive {{CustomVar code="CUSTOM_VAR_CODE"}} in Content > Static > Blocks it always retrieves the Variable HTML Value, but there is no way or documentation on how to retrieve the Plain Value using directive {{CustomVar code="CUSTOM_VAR_CODE"}} ?

Please share thoughts


texts: Adding new input fileds for attributes in a specific attribute group - Magento 2.3

texts:
I created a new attribute group 'Features' in the products section. I need to create two new fields (checkbox and text field) apart from the available option for attributes inside the group 'Features'. I am a beginner in Magento so any help is really appreciated.

Note: I need those extra fields for attributes inside the group 'Features' only

Thanks in advance.


texts: Magento htaccess frontend authentication

texts:
Is it possible to block just frontend with htaccess? If I setup normal htaccess authentication to root then it block uploading images from admin.

I'm aware there is IP blocking possibility but htaccess authentication works way better for us.


texts: Created Static Block Successfully if i clicked the block it will redirect to Category Page


texts: Magento 2 i want to customize default magento report to time wise

texts: I want to customize Magento default 'Ordered Products Report' filter with time.


texts: PHP memory limit issues repeats after the updating to a bigger size

texts:
I have updated the memory limits to 1024M in the php.ini file in the root directory however while installing the extension, am still getting the error stating to update the memory to 756M or above.

Am using magento 2.


texts: Stamps.com integration - shipping emails not being sent

texts:
We have a Magento store that we've linked to Stamps.com to print out the shipping labels. We've almost got it working properly. However, we have an issue with Shipping emails.

We want to send them out through Magento, as the Stamps.com emails don't get branded correctly. If we do this inside Magento by opening the order and clicking the Ship button, the emails are sent as expected. They go to the customer, and there's a copy sent via BCC to the address specified.

When we use Stamps.com, though, the customer emails aren't getting sent out. The order is being updated correctly with the right status and with the tracking number; and Magento is sending out a tracking email - but it's sending it directly to the BCC address. There's no customer copy sent, and the To: address in the sent email is the address it should be BCCing to.

Is there a setting email I've missed for this? I've looked everywhere I can, but I've not been able to find anything that looks like it would help for this.


texts: Initializing and updating vars used in a phtml. What is the proper way?

texts:
I am implementing a quotation form. I then declared a module in which I defined a phtml template containing the form, the computed price display and the javascript/ajax script.

I also have defined a block :

<?php
class Mine_Quotemodule_Block_Quoteformblock extends Mage_Core_Block_Template
{
     public function methodblock()
     {
         return 'informations de mon block !!';
     }
}
?>

and a controller

<?php
class Mine_Quotemodule_IndexController extends Mage_Core_Controller_Front_Action
{
   public function indexAction()
   {
        $this->loadLayout();
        $this->renderLayout();
   }

   public function quoteAction()
   {
     echo 'test mamethode';
    }
}
?>

In order to be able to display and update my quotation price, I need to use some vars.

I thought declaring and initializing them in the indexAction() (for default price display) and update them in quoteAction() which will be called by my form script.

Is this the good way?

if declared in indexAction, how to refer to them in quoteAction() and in the phtml?

Thank you for your help,

Alex


texts: path of php.ini file in magento folder structure

texts:
i want to find the path of php.ini file

we saw somewhere it's here : /usr/local/lib/php.ini

where we can find the path of "/usr/local/lib/".

please help me to find solution.

thanks in advance


texts: Magento 2 There are many page visits with duplicate “/storecode” , in google Analytics:

texts:
It only happens for product pages. Checking Google Analytics for a sample page showed the user came from magento’s search results:

  how to remove this multiple store code from my magento 2 store

http://prntscr.com/p24602


texts: Issue with search bar caching in Magento 2 after moving it into top menu

texts:
Ive recently been working on a change for the search bar field. I have decided to add a toggled search bar inside of my navigation bar which is activated through jquery.

My form-mini.phtml is being called inside of topmenu.phtml like below once the search icon is clicked.

<?php include ($block->getTemplateFile('Magento_Search::form.mini.phtml')) ?>

Everything is working the way we would hope except for search terms entered in this field. The issue occurs when the first person who searches a product on the site will have their search cached and the value field will have their search term populated for everyone on the site trying to use the search function.

How would I stop the search from caching without setting cacheable="false" as I do not want to disable cache on every page of the site.

Search: MySQL

Cache: Varnish and Magento Full Page Cache


texts: Slow MySQL on category pages queries after importing product reviews

texts:
I recently imported over 1 thousand client reviews. Right after importing categories and filters went extremely slow. I found the following SQL to be cause, but I cannot find how to change it to keep the reviews and get the site back to normal. Anyone can help ?

Thanks !

COUNT(DISTINCT e.entity_id),
ROUND(MAX(price_index.min_price ) * 1, 100) AS `max`,
ROUND(MIN(price_index.min_price ) * 1, 100) AS `min`,
STDDEV_SAMP(ROUND((price_index.min_price ) * 1, 100)) AS `std`
FROM `catalog_product_flat_1` AS `e`
 INNER JOIN `catalog_category_product_index_store1` AS `cat_index` ON cat_index.product_id=e.entity_id AND cat_index.store_id=1 AND cat_index.visibility IN(2, 4) AND cat_index.category_id=13
 INNER JOIN `catalog_product_index_price` AS `price_index` ON price_index.entity_id = e.entity_id AND price_index.website_id = '1' AND price_index.customer_group_id = 0
 LEFT JOIN `cataloginventory_stock_status` AS `_inv` ON _inv.product_id = e.entity_id and _inv.website_id=0
 LEFT JOIN `review_entity_summary` AS `review_summary` ON e.entity_id = review_summary.entity_pk_value AND review_summary.store_id = 1 AND review_summary.entity_type = (SELECT `review_entity`.`entity_id` FROM `review_entity` WHERE (entity_code = 'product'))
 INNER JOIN `cataloginventory_stock_status` AS `stock_status_index` ON e.entity_id = stock_status_index.product_id
WHERE (price_index.min_price IS NOT NULL);```


texts: How to create a plugin to block magento2 from sending order confirmation mail?

texts: Need to block magento from sending orderconfirmation mail through a module. Which is  the efficient method to do so ?


texts: Magento 2: Custom product attribute in FinalPrice afterGetValue

texts:
I have created a plugin to modify the final price with afterGetValue.

<type name="Magento\Catalog\Pricing\Price\FinalPrice" shared="false">
    <plugin name="my_module_plugin_product_price" type="My\Module\Plugin\Product" disabled="false" sortOrder="999" />
</type>

Plugin:

namespace My\Module\Plugin;

class Product
{
    public function afterGetValue(\Magento\Catalog\Pricing\Price\FinalPrice $subject, $result) : float
    {
        $product = $subject->getProduct();
        // Does not work unless loaded
        $product->load($product->getId());
        return $product->getFinalPrice() * $product->getUnits();
    }
}

The price should be modified based upon a product's custom eav attribute ("units"). But unless the product get's fully loaded the attribute value is not available.

How can I tell magento to always load a custom attribute?

EDIT: I found out that placing a catalog_attributes.xml into the etc folder of my module is supposed to achieve exactly what I want:

<?xml version="1.0"?>
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Catalog:etc/catalog_attributes.xsd">
    <group name="catalog_product">
        <attribute name="units" />
    </group>
    <group name="quote_item">
        <attribute name="units" />
    </group>
</config>

Unfortunately it does not work at all (magento 2.2.7). Am I missing something?


texts: Magento 2 : System Configuration select email templates not working

texts:
I'm trying to render a select field with email templates under Sytemem->Configuration
.
When i open the configuration tab it doenst show any config fields more.

Here are my files

  etc/system.xml

  <field id="pickup_template" translate="label comment" type="select" sortOrder="3" showInDefault="1" showInWebsite="1" showInStore="1">
                New Order Confirmation Template for Guest
                <comment>Email template chosen based on theme fallback when "Default" option is selected.</comment>
                <source_model>Magento\Config\Model\Config\Source\Email\Template</source_model>
  </field>

  etc/email_templates.xml

   <template id="pickup_template" label="New Order" file="yourfile.html" type="html" module="Hello_StorePickup" area="frontend"/>

  view/frontend/email/yourfile.html

    message


texts:
in my Magento Store I need to set some Cron to:
- Run maintenance.php
- Apply Catalog Rule and after that Refresh Cache
- Refresh Sitemaps

My hosting create a curl to cron.php but I don't know how to modify my cron.php to run this operations.
Can someone help me?
This is my cron.php

  require 'app/Mage.php';

  if (!Mage::isInstalled()) {
      echo "Application is not installed yet, please complete install wizard first.";
      exit; }

  // Only for urls // Don't remove this $_SERVER['SCRIPT_NAME'] =
  str_replace(basename(FILE), 'index.php', $_SERVER['SCRIPT_NAME']);
  $_SERVER['SCRIPT_FILENAME'] = str_replace(basename(FILE),
  'index.php', $_SERVER['SCRIPT_FILENAME']);

  Mage::app('admin')->setUseSessionInUrl(false);

  umask(0);

  try {
      Mage::getConfig()->init()->loadEventObservers('crontab');
      Mage::app()->addEventArea('crontab');
      Mage::dispatchEvent('default'); } catch (Exception $e) {
      Mage::printException($e); }

How should I modify it?
Thanks to everyone


texts: custom shipping address date field validation

texts:
I've added a custom field to the shipping address in checkout:

$jsLayout['components']['checkout']['children']['steps']['children']['shipping-step']['children']
        ['shippingAddress']['children']['shipping-address-fieldset']['children']['date'] = [
            'component' => '<vendor>_<module>/js/shipping-provider',
            'config' => [
                'customScope' => 'shippingAddress',
                'template' => 'ui/form/field',
                'elementTmpl' => '<vendor>_<module>/date',
                'options' => [],
                'id' => 'date'
            ],
            'dataScope' => 'shippingAddress.date',
            'label' => __('Date'),
            'provider' => 'checkoutProvider',
            'visible' => true,
            'validation' => [
                'required-entry' => true
            ],
            'sortOrder' => 200,
            'id' => 'date'
        ];

As you can see I set required-entry to true for validation purposes. But now I always get that the field is a required field error message even though the field has a value set.

Here is the field:

<input class="input-text" type="text" data-bind="
    hasFocus: focused,
    datepicker: { storage: value, options: options },
    attr: {
        value: value,
        name: inputName,
        placeholder: placeholder,
        'aria-describedby': noticeId,
        disabled: disabled
    }" readonly/>

Any idea on this?

Update
Here is the shipping-provider.js

define([
    'Magento_Ui/js/form/element/abstract',
    'jquery',
    'mage/calendar'
], function (Abstract, $, calendar) {
    'use strict';

    $.extend(true, $, {
        calendarConfig: {
            onSelect: function (date, datepicker) {
                // do stuff
            }
        }
    });

    return Abstract.extend(Abstract, calendar);
});


texts: Magento 2: How to programatically mark product image as hidden from product page?

texts:
I'm trying to programatically set the "Hide from Product Page" setting on an image.

The setting can be found here: Products > Catalog > (select a product) > Images And Videos > (click on an image).

So far, the only way I've been able to change that setting, is by doing it manually.

Here's how I currently add images to my products:

$product->addImageToMediaGallery($imagePath, ['thumbnail'], false, true);
$product->save();

I thought that the last parameter which is called exclude and described as mark image as excluded from product page view would do the trick, but it doesn't. Regardless of if I set the value to trueor false, the image remains visible on the product page and the checkbox is unchecked.

I've been banging my head against a wall for the better part of a day now, so any suggestions will be greatly appreciated.


texts:
I got Fatal error in my website

: Call to a member function getId() on a non-object in price.php file

/app/code/core/Mage/Catalog/Model/Product/Type/Configurable/Price.php

I don't know what is the problem for this.


texts: The best way to set and call layout is in controller or in the layout.xml?

texts:
I know that in Magento there are two ways to call a layout:

in controller something like:

public function indexAction(){
    $this->loadLayout();
    //...
    $block = $this->getLayout()->createBlock('core/template')->setTemplate('custom/myfile.phtml')->toHtml();
    echo $block;
    //...
    $this->renderLayout();
}

in xml:

config.xml

<frontend>
  <layout>
    <updates>
      <mymodule>
        <file>mymodule.xml</file>
      </mymodule>
    </updates>
  </layout>
</frontend>

mymodule.xml

<router_index_index translate="label">
    ...
    <reference name="content">
      <block type="core/template" name="block.name" template="custom/myfile.phtml"/>
    </reference>
</router_index_index>

The both work of course but what is the best ways to do it and what is the difference between theme.


texts:
Whenever i am selecting any attribute or make any change in a product and try to save it in my magento store backend i am getting following error.

SQLSTATE[42000]: Syntax error or access violation: 1064 You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ') ) AND (p.entity_id = '1696') LIMIT 1' at line 3, query was: SELECT DISTINCT p.entity_id FROM `catalog_product_entity` AS `p` INNER JOIN `catalog_product_flat_1` AS `cpf` ON cpf.entity_id = p.entity_id LEFT JOIN `catalog_category_product` AS `ccp` ON ccp.product_id = p.entity_id WHERE ( () ) AND (p.entity_id = '1696') LIMIT 1

Kindly let me know what is causing this error and how i can resolve this.


texts:
i have customize the css to change the color of menubar for my magento website, it is working fine for google chrome and mozila firfox but in safari browser menubar color is showing white it don't know what is the problem.  here is my site http://www.flirtwithhair.com/classic/

my css code after changes

.nav-container {
    background: linear-gradient(to bottom, #940c94 0%, #f4f1f1 100%) repeat scroll 0 0 rgba(0, 0, 0, 0);
    border: 1px solid #eae5e4;
}

changes done : #ffffff   to  #940c94


texts: Magento 2.2 Cant find how to disable module from back end

texts:
I am using Magento 2.2 I can't find a way to disable module. It was use to be under configuration > Admin but it's not there anymore..

Can someone please help me out.thanks


texts:
How can I make a fieldset to be half of the width? I want to show two fieldsets in a row in a particular page that I created in Magento's admin.

My code looks like this for now:

$fieldset_brand = $form->addFieldset('brand_fieldset', array(
                'legend' => $this->__('Brand categories'),
                'class' => 'fieldset-wide',
            ));

Any ideeas?
Or at least, from what I see, this is not quite a fieldset. It generates two div for title bar and the actual content. Is there a way to set a wrapper around those?

Any help is welcomed :)


texts: How to get selected Order Ids in block from Sales Order Grid? Magento2

texts:
I want to generate PDF of selected orders, Rest of the functionality is complete just wanted to get selected Ids from sales order grid. For now I am getting full list of Orders on clicking my custom action. I am passing Order collection to controller action from custom block. This is what I wanted to get in block:

My Block Class is:

class Order extends \Magento\Framework\View\Element\Template {

public function __construct(\Magento\Framework\View\Element\Template\Context $context,
                          \Magento\Sales\Model\ResourceModel\Order\CollectionFactory $orderCollectionFactory,
                          \Magento\Sales\Model\OrderRepository $orderRepository
                          ..........
                          array $data = []
) {
.....

parent::__construct($context, $data);
}
public function getOrders() {
        //$ids = '24,23,21,16';
        $orderCollection = $this->_orderCollectionFactory->create()->addFieldToSelect('*');
        //$orderCollection = $orderCollection->addFieldToFilter('entity_id', ['in' => $ids]);
        return $orderCollection;
}

And Controller is:
    use VendorName\ModuleName\Block\Order;

class CreatePdf extends \Magento\Backend\App\Action  {
public function __construct(Context $context,Order $order, DirectoryList $dir, PageFactory $resultPageFactory)
{

    parent::__construct($context);
}

public function execute() {

    //Custom Logic
}

I followed this link but it is not working, https://stackoverflow.com/questions/24884544/how-can-i-get-the-selected-order-ids-in-custom-action-in-sales-order-on-click

Thanks


texts: What is the functional difference of Block & Container in Magento 2?

texts:
Block vs Container functional difference.

I have followed this url but doesn't clear much for me.

  Which type of classes are extended by block and container.

Note : I know how containers and Block with everything else all works.

I want to understand Magento classes which are extended by block and container that implements rendering of a particular block & container, And also How it handles rendering child elements during view output generation.


texts: Magento 1.7.0.2 CE: jQuery conditional show  if top element has specific class

texts:
We use bundle item.
Customer can make a combination of different sku's.
We group the sku' in logical sections (e.g. motor, color, wheels, ...).
Some groups are required to have at least one entry others not (e.g. accessory).

Initially all groups are toggled hidden for easier orientation.
After clicking "Add to cart" we show all groups with jQuery('dd').show() to enable the magento validation of the checkbox groups (required or not).

Question: We just want to show all groups (element
) if the above label
of
 has the class "required" or if easier use the class="validate-one-required-by-name" from the child input box within the
 element. So the customer has the focus only on the required bundle groups he has to mark es checked.

HTML Structure is:

  <--- this i want to show if  class of above
 is "required".

<input class="...validate-one-required-by-name"></input>

<input class="...validate-one-required-by-name"></input>

<input class="...validate-one-required-by-name"></input>

How can I make the show of
 element dependent from the above
  class "required" or from the child class of the <input-box> in the
 list?

Finally found the answer:

jQuery('input').filter('.validate-one-required-by-name').closest('dd').show();


texts: Issue while editing the grouped products from backend Notice: Undefined index: link_type after upgrade site from magento 2.2.4 to magento 2.3.5-p1

texts:
Facing issue after upgrade my Magento site from 2.2.4 to 2.3.5-p1.
Notice: Undefined index: link_type in /vendor/magento/module-catalog/Model/ProductLink/ProductLinkQuery.php on line 177


texts: How to remove zoom on hover on product image in view page in Magento2?

texts:
How to remove the zoom feature on hover on the product image in product view page?

I have tried below code, but it is not working.

<var name="gallery">
    <var name="allowfullscreen">false</var> <!-- Turn on/off fullscreen (true/false) -->
</var>
<var name="magnifier">
   <var name="enabled">false</var> <!-- Turn on/off magnifier (true/false) -->
</var>


texts: How to copy store configuration to a new magento install?

texts:
I have implemented a new magento install  (with its own database) in order to have a development version of my e-commerce site.

I would like now to copy the configuration / products ... (everything in fact) of the original version to have an exact copy of my shop.

how can I do that?

Thank you for your help,


texts: 404 in the backend in updating products/orders

texts:
I am getting 404 Errorin backend on updating products, orders but nothing shows in system.log.

I can access the backend however with no troubles.What can cause this problem and how to fix it?


texts:
I installed a new extension on my site, but couldn't enable it.

ran command php bin/magento module:status
I can see it was enabled, but it's disabled on module manager.

Thanks


texts: CE 2.2.1 migration fails with "Killed" on MAP STEP at 53%

texts:
Migrating 1.9.3.3 CE to 2.2.1 CE : Migration fails 53% with the message "KILLED". No information in the migration.log that I can find that's helpful. memory_limit = -1.. out of ideas.

[2017-11-11 03:28:42][INFO][mode: data][stage: data migration][step: Map Step]: started
53% [==============>-------------] Remaining Time: 1 secKilled


texts: Magento 1.9 - exception 'Mage_Core_Exception' with message 'Invalid block type

texts:
Checking the log file of Magento 1.9, in two web site, I find this row:

  exception 'Mage_Core_Exception' with message 'Invalid block type: ES_Newssubscribers_Block_Newssubscribers

How to remove this type of error?

Thanks


texts:
How do you use less inside custom module

having created code/Vendor/module/view/frontend/web/css/source/custom.less

how do I include and compile?


texts: After upgrade magento 2.2.4 to 2.2.6 web setup wizard not display

texts:
I have just upgrade magento 2.2.4 to 2.2.6 and noticed that web setup wizard not display.

It was displayed in 2.2.4 found that already reported here https://github.com/magento/magento2/issues/7623

Does anyone have the idea what if I supposed to do to re-appear this tab?
I think Magento will consider it in next release.


texts: Adding a css class to knockout without breaking the default code

texts:
I'm trying to add a css class in the field.html that is used on checkout.

My code:

Now it does add the 'hideBusiness' class but the default class '_required' gets removed from the field. I'm not sure why that is?

This is the output:

~~ other code ~~

Without my code it outputs:

~~ other code ~~

I feel like it might have to do with the double css binding but i'm not sure how to combine them?


texts:
I'm working on a Magento 2 module that may require a lot of form filling in the backend that in some cases may cause the session to expire.
I want to avoid this.
I know that theoretically I can make an ajax call to any page every X seconds to prolong the session, but I want to do it right.
Is there already an action that does nothing else but prolonging the session or do I have to create one?
Or is there an other way to prevent the session from expiring only when on a specific admin page?


texts: Site stopped working after adding custom theme

texts:
I created custom theme ( having only theme.xml,regisration.php file and medial/preview.jpg ).

Logged in to admin panel and went to Conetnt->Design->Configurations so i could change the theme to my custom theme. but it shwoing me loadder file and no recored is showing. So i flushed the cache and now my frontend is not loading. Admin is working fine but theme sections is also not working.

I am working in default mode and my magento version is 2.2.3. Any help will be highly appreciated.


texts: Override modal-popup.html file Magrnto 2.3.2

texts:
Override vendor/magento/module-ui/view/base/web/templates/modal/modal-popup.html File Into Theme..

How To Override base/ folder file into theme ???

I m Try To Paste this file in to theme/Magento_Ui/templates/modal-popup.html But Not Working.


texts:
Can anyone explain the difference between

getBaseSubtotal
getSubtotal
getBaseGrandTotal
getGrandTotal
getSubtotalInclTax
getBaseSubtotalInclTax
getBaseSubtotalWithDiscount
getSubtotalWithDiscount

Maybe some "total" param has been missed.
Thanks!


texts: Magento 2 Unable to redirect http to https when using multistore

texts: I am unable to redirect HTTP to https when using a multistore option. Anyone else using more than one store and has the http->https auto redirection working from .htaccess?


texts: Merchant Review Invitation Error already exists: 104404271 error on new order shipment

texts:
I am facing issues while generating new shipment admin order. Please check below image.

Anybody have any idea about it ?